我正在尝试访问“ hp_location_block__container” 容器中的数据,但是目前,即使使用PhantomJS,我也无法获得任何回报:
from selenium import webdriver
from bs4 import BeautifulSoup
if __name__ == '__main__':
url = "https://www.booking.com/hotel/tz/zuri-zanzibar.html"
driver = webdriver.PhantomJS()
driver.get(url)
html = driver.page_source
soup = BeautifulSoup(html)
soup.findAll("div", {"class": "hp_location_block__container "})
我得到:
Out[1]: []