sd
This commit is contained in:
commit
5d50f8d536
16
main.py
Normal file
16
main.py
Normal file
@ -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)
|
||||
Loading…
x
Reference in New Issue
Block a user