2022-10-03 12:46:40 +02:00

17 lines
652 B
Python

# 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)