Ghost.py icon indicating copy to clipboard operation
Ghost.py copied to clipboard

The webpage content that ghost load different from my real web browser load

Open Snowhere opened this issue 11 years ago • 1 comments

For example.

I use the package urllib2 to load a webpage, get webpage content_one. I use real web browser (chrome) to load a webpage ,get webpage content_two. I use ghost to load a webpage, get webpage content_three.

content_one == content_two <> content_content_three

And when I open some website, content_one and content_two are normal ,but ghost will get a redirected page (such as error page)

Snowhere avatar Oct 12 '14 14:10 Snowhere

Are the HTTP requests you're sending the same? Ghost's user agent could cause some sites to redirect you to other URLs. You can change the user agent like so:

ua_string = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0" ghost = Ghost(user_agent=ua_string)

rfmcpherson avatar Oct 16 '14 20:10 rfmcpherson