Last active
July 20, 2022 15:32
-
-
Save fergalmoran/4f818fa340f17c1b3417b8ce135c6837 to your computer and use it in GitHub Desktop.
Get prices from page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
import time | |
from bs4 import BeautifulSoup | |
options = webdriver.ChromeOptions() | |
options.add_argument('--incognito') | |
options.add_argument('--headless') | |
driver = webdriver.Chrome(options=options) | |
driver.get('https://newthink.lenovo.com.cn/deviceGuarantee.html?selname=SA14632514') | |
time.sleep(10) | |
h = driver.page_source | |
soup = BeautifulSoup(h, 'html.parser') | |
dates = soup.find_all("p", {"class": "pc-dates"}) | |
for date in dates: | |
print(date.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment