【发布时间】:2021-04-28 14:34:32
【问题描述】:
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
PATH = "/Users/macop/Tools/ChromeDriver/chromedriver"
driver = webdriver.Chrome(PATH)
driver.get("https://www.zomato.com/ncr/dominos-pizza-connaught-place-new-delhi/order")
time.sleep(5)
link = driver.find_element_by_class_name("hppEfq").get_attribute('src')
print(link)
for name in link:
print(name.text)
driver.quit()
我得到的最后一个错误:
Message: no such element: Unable to locate element: {"method":"css selector","selector":".hppEfq"}
正在查找该页面的属性 src 的 img 标记中所有链接的列表...
【问题讨论】:
标签: python selenium web-scraping src