2

I want to use a python script on pythonanywhere and make some tests on Instagram with Selenium. I know that pythonanywhere has Firefox 17 and there is no possibility to upgrade it.

Everything works, I have no problems with Selenium, the problem is Instagram on Firefox 17.

Whe I try to go on http://www.instagram.com the page is simply white apparently without content. I tried to reproduce the error on my computer installing firefox 17, and I've tried to load the page without style. And then I saw this:

Facebook security warning

And of course my script gave me an exception because it couldn't find the log in button.

Somebody know how to ho over it?

Danny_DD
  • 756
  • 1
  • 12
  • 34
  • BTW: PythonAnywhere blocks most urls (to avoid sending spam) and it has [white list for free user](https://www.pythonanywhere.com/whitelist/) – furas Dec 10 '17 at 14:29
  • Maybe you could use `Splash` or `PhantomJS`instead of `Firefox`. See [Headless Functional Testing with Selenium and PhantomJS](https://code.tutsplus.com/tutorials/headless-functional-testing-with-selenium-and-phantomjs--net-30545) or [Selenium phantomjs](https://pythonspot.com/en/selenium-phantomjs/) – furas Dec 10 '17 at 14:34
  • BTW: you could crop image. – furas Dec 10 '17 at 14:35
  • BTW: [A list of (almost) all headless web browsers in existence](https://github.com/dhamaniasad/HeadlessBrowsers) – furas Dec 10 '17 at 14:41
  • or maybe you should change `User-Agent` header in browser [Change user agent for selenium driver](https://stackoverflow.com/questions/29916054/change-user-agent-for-selenium-driver) and [Firefox user agent string reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox) Or check your browser `user-agent` using [httpbin.org](http://httpbin.org/) and [httpbin.org/user-agent](http://httpbin.org/user-agent) – furas Dec 10 '17 at 14:45
  • Or maybe Firefox 17 uses old ceritficates for HTTPS connections and this is why you see `SECURITY WARNING` – furas Dec 10 '17 at 14:58
  • my problem is that pythonanywhere supports only firefox. No chance to switch to phantomJS or Splash. – Danny_DD Dec 10 '17 at 15:37
  • can't you install phantomJS or Splash manually to your project ? If not then you maybe should buy VPS server - it should be cheap - and then you can install whatever you need. – furas Dec 10 '17 at 15:40
  • I tried to change user-agent but it doesn't work anyway. I think there is no solution, only to pay for a remote server where I can install whatever I want. Not, nice, pythonanywhere could be a perfect and free solution. – Danny_DD Dec 10 '17 at 16:00

0 Answers0