Answer the question
In order to leave comments, you need to log in
Site parser loadable with js?
Please help me write the site trackadsb.com/VirtualRadar/desktop.html .
I want to get the data inside
I look at the page code, it's empty inside. And in fact there is a list of aircraft.
Here is the code in python
from bs4 import BeautifulSoup
import requests
comps=[]
def parse():
URL='http://trackadsb.com/VirtualRadar/desktop.html#'
HEADERS={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'}
response =requests.get(URL, headers=HEADERS)
soup=BeautifulSoup(response.content, 'html.parser')
items=soup.find('div', id="aircraftList")
for item in items:
comps.append(
item.get_text())
#for comp in comps:
# print(comp[title])
print(comps)
parse()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question