Доброго времени суток
Возникала нужда про парсить характеристики товара с данного сайта \
Возникала нужда про парсить характеристики товара с данного сайта \
Python:
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-gpu")
#chrome_options.add_argument("--no-sandbox") # linux only
chrome_options.add_argument("--headless")
# chrome_options.headless = True # also works
driver = webdriver.Chrome(options=chrome_options)
catalog = []
with open('url.txt','r')as f:
for url in f:
catalog.append(url)
catalog = catalog[:3]
for url in catalog:
driver.get(url)
har = str(driver.find_element_by_xpath("table@calss[props_list]//tr@itemprop=['additionalProperty']").text)
open('har.txt', 'a').write(har+'/n')
print (har)
SyntaxError: Failed to execute 'evaluate' on 'Document': The string 'table@calss[props_list]//tr@itemprop=['additionalProperty']' is not a valid XPath expression.