我正在尝试从链接steel下载pdf文件(“下载产品目录”)。使用python xpath实现此目的。但出现语法错误。尝试了所有排列和组合。我尝试过的代码如下:
import time
from selenium import webdriver
driver = webdriver.Chrome('c:/windows/chromedriver.exe') # Optional argument, if not specified will search path.
driver.get("https://sail.co.in/en/products/sail-structural-sections")
time.sleep(5) # Let the user actually see something!
elem =driver.find_element_by_xpath('//a[text()='Download Product Catalogue']//parent::div[@class='toppdf_brochure pdfbrochure']')
elem.click()
time.sleep(5) # Let the user actually see something!
driver.quit()