phantomjs and selenium

Corresponds to javascript

Remarks

Installation

I simply installed and tested Selenium and Phantom.js, but it didn't seem to run with no errors.

An error occurs when only Phantom.js is executed

phantomjs QXcbConnection Could not connect to display

It seems that it came out because it can not even draw in the first place because it is an environment without a desktop. If you look it up, you will find:

Python - Taking Browser Screenshots With No Display (Selenium/Xvfb)

I installed xvfb and PyVirtualDisplay and confirmed that phantom.js works normally. No problem from python via PyVirtualDisplay.

Phantom.js was up to apt in Debian phantomjs_2.1.1

Since the environment is created properly, it can't be helped because it's dirty. Should I use pyenv or a container?

Recommended Posts

phantomjs and selenium
selenium
Challenge Python3 and Selenium Webdriver
Scraping with Python, Selenium and Chromedriver
Selenium and python to open google
I used phantomjs from Python's selenium library and it became a zombie
selenium: wait for element with AND / OR
Reboot the router using Python, Selenium, PhantomJS
Screenshots of Megalodon in selenium and Chrome.
Practice web scraping with Python and Selenium
Use selenium phantomjs webdriver with python unittest
About _ and __
I tried web scraping using python and selenium
Drag and drop local files with Selenium (Python)
Frequently used methods of Selenium and Beautiful Soup
I tried various things with Python: scraping (Beautiful Soup + Selenium + PhantomJS) and morphological analysis.