选择器 driver.page_source 不 return 所有 html
Selector driver.page_source does not return all html
我正在 python 中使用来自 scrapy 的选择器编写代码。
selector = Selector(text=driver.page_source)
未返回页面的 html。
知道为什么吗?
试试这个:
from selenium import webdriver
driver = webdriver.Chrome("C:/path/to/chromedriver.exe")
driver.get("http://google.com")
selector = driver.page_source
print(selector)
我正在 python 中使用来自 scrapy 的选择器编写代码。
selector = Selector(text=driver.page_source)
未返回页面的 html。
知道为什么吗?
试试这个:
from selenium import webdriver
driver = webdriver.Chrome("C:/path/to/chromedriver.exe")
driver.get("http://google.com")
selector = driver.page_source
print(selector)