Reputation: 51
I can't scrape this site here is a screenshot of the request on python selenium phantomjs. I dont know how they detected it was a bot but says on the picture need javascript and need captcha and maybe what other things needed to? Definitely Im not scraping at superhuman speed because it is my first request so it was not the cause. P.S. when I paste the same request on my browser it directs to the page that i want and works okay.
br = webdriver.PhantomJS('bin/phantomjs')
br.set_window_size(1366, 200)
br.get("website")
br.save_screenshot(x)
Upvotes: 1
Views: 1941
Reputation: 593
Things that can help in general :
Upvotes: 0
Reputation: 51
Well I got it working now. I'll simply put this for the sake of other people who doesn't. enable javascript and fake useragent
cap = webdriver.DesiredCapabilities.PHANTOMJS
cap["phantomjs.page.settings.javascriptEnabled"] = True
cap["phantomjs.page.settings.loadImages"] = True
cap["phantomjs.page.settings.userAgent"] = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0'
br = webdriver.PhantomJS('bin/phantomjs',desired_capabilities=cap)
Upvotes: 3