我正在尝试抓取一个网页,但我无法使用selenium获取网站的html文本。在
这是我目前为止的代码
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
import urlparse
search_term = raw_input("What is your search term?: ")
url = "https://www.google.co.uk/search?client=ubuntu&channel=fs&q="
googurl = url+search_term
driver = webdriver.Firefox()
htmltext = driver.get(googurl)
soup = BeautifulSoup(htmltext.page_source)
回溯一下
^{pr2}$
您希望始终使用驱动程序对象:
相关问题 更多 >
编程相关推荐