selenium - difference between chromedirver and phantomjs with python -
i’m working make web crawler python using selenium
here, got contents using chromedriver, problem occurred when tried make headless access crawling through phantomjs. find_element_by_id
, or find_element_by_name
did not work there difference between these? trying make headless because want run code in ubuntu server batch job without gui support.
my script below.
from selenium import webdriver selenium.webdriver.common.by import import time selenium.webdriver.common.keys import keys bs4 import beautifulsoup import re #driver = webdriver.phantomjs('/users/user/downloads/phantomjs-2.1.1-macosx/bin/phantomjs') #driver = webdriver.chrome('/users/user/downloads/chromedriver') driver = webdriver.phantomjs() driver.set_window_size(1120, 550) driver.get(url) driver.implicitly_wait(3) #here tried 2 different find_tag things both didn’t work user = driver.find_element(by=by.name,value="user:email") password = driver.find_element_by_id('user_password')
wiki
Comments
Post a Comment