PhantomJS fail to open HTTPS site

Post on by michaelyin

Intro

When I develop automation tool based on phantomjs, it can not open some https website, so I spend some time to figure out how to solve this strange problem.

Solution 1

You can use the command option --ignore-ssl-errors=true of phantomjs to make it ignore the ssl error, so it can load the page

Solution 2

Solution 1 can indeed solve the problem but it can not make sure ...


Enhance your scrapy shell

Post on by michaelyin

In the development of the web spiders using scrapy framework, scrapy shell is very helpful because it can make developer debug the code quickly, however, I found that I have to type many imports to import the module into the shell, which is very time consuming.

So I dive into the scrapy source code to find a way to make me feel better when using scrapy shell. Here is my ...


Convert 8-bit byte to signed int in python

Post on by michaelyin

Python has provided library to handle bit maniputation in most cases, however, I can not find a good way to convert a 8-bit single byte to signed int type using built-in lib.

Scenario

Here is scenario, some newbie Java developer need to hash the password and save it to database, he did not convert to hash result to hex string but just called toString to save it to database.

The ...


How to debug your scrapy spider

Post on by michaelyin

Intro

This post will talk about some useful tips in the development of scrapy spider which can help you write your spider quickly

Extract infomation

Some newbie developer think the expression supported by scrapy is difficult to learn, but the truth is, compared to the methods like find_by_id, find_by_name in some framework, the xpath, css, and re expression is very extensible and easy to maintain, then work well even in ...


Handle autocomplete using selenium

Post on by michaelyin

Selenium is a so great tool to make web ui test, in some cases, we have to make it work with some ajax autocomplete like jquery ui autocomplete.

First you need to understand how the autocomplete work. Most plugin will create a ul which contain data get from the server by ajax, and insert the ul into the body, then display it for user to click by mouse or enter ...