Update parcing.py

This commit is contained in:
13danny13
2023-03-22 22:45:38 +03:00
committed by GitHub
parent 9e94e914de
commit 5a13ad4255
+3 -3
View File
@@ -8,7 +8,7 @@ browser = webdriver.Chrome(service=s)
browser.get('https://trial-sport.ru/gds.php?s=51516&c1=1070639&c2=1070640') browser.get('https://trial-sport.ru/gds.php?s=51516&c1=1070639&c2=1070640')
html_text = browser.page_source html_text = browser.page_source
soup = BeautifulSoup(html_text, 'lxml') soup = BeautifulSoup(html_text, 'lxml')
bike_name=soup.find_all('a', class_='title') product_name=soup.find_all('a', class_='title')
print (bike_name[0].text)
description=soup.find_all('span', class_='description') description=soup.find_all('span', class_='description')
print (description[0].text) for product_name, description in zip(product_name, description):
print(f"Продукт: {product_name.text} \nОписание: {description.text}")