Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
786 B
1
Indexable
Never
from selenium import webdriver
from msedge.selenium_tools import EdgeOptions

# %%
_edge_options = EdgeOptions()
driver = webdriver.Edge(
    executable_path="C:\\Users\quang\\PycharmProjects\\laptops-price-analysis-and-prediction\\Scrape\\msedgedriver.exe")
driver.get("https://fptshop.com.vn/dien-thoai/iphone-13-pro-max?dung-luong=128gb")
driver.find_element_by_link_text("Xem cấu hình chi tiết").click()

# %%
lines = driver.find_elements_by_css_selector("div.c-modal__content ul > li")
tables = driver.find_elements_by_css_selector("div.c-modal__content table > tbody > tr")
# %%
for line in lines:
    name = line.text.strip()
    print(name)

for row in tables:
    name, value = row.find_elements_by_css_selector('td')
    print(name.text, value.text)