From 5d50f8d536e3dcc4f6185b1a873ca3f819e8d137 Mon Sep 17 00:00:00 2001 From: dennis Date: Mon, 3 Oct 2022 12:46:40 +0200 Subject: [PATCH] sd --- main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..3265fbd --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +# Import required modules +from lxml import html +import requests +from selenium import webdriver + +browser = webdriver.Chrome() +#Choose url you want to scrape +url = 'https://ladekort.clever.dk/?lat=56.18810417048913&lng=10.190360992725642&zoom=16&location=11336&filter=regular,fast,ultra&status=available,outOfOrder,unavailable' +#get the url with Selenium +browser.get(url) +#get the innerhtml from the rendered page +innerHTML = browser.execute_script("return document.body.innerHTML") + +# Get element using XPath +status = innerHTML.xpath('/html/body/div[1]/div/div/div/div/div/div[2]/div[3]/span/article/div/div/div/ul/li/div/span[1]/strong') +print(status)