forked from supercoderz/pyflightdata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoc_testing.py
37 lines (37 loc) · 1.01 KB
/
poc_testing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This is how we prove that this aproach works
import requests
result = requests.get('http://www.flightradar24.com/data/flights/ac16/')
result.status_code
from bs4 import BeautifulSoup
soup = BeautifulSoup(result.content)
soup.find(id='tblFltData')
soup.find(id='tblFlightData')
soup.find(id='tblFlightData').tr
soup.find(id='tblFlightData').tr
soup.find(id='tblFlightData').find_all('tr')
soup.find(id='tblFlightData').find_all('tr').__len__()
soup.find(id='tblFlightData').find_all('tr')[4]
type(soup.find(id='tblFlightData').find_all('tr')[4])
dir(soup.find(id='tblFlightData').find_all('tr')[4])
type(soup.find(id='tblFlightData').find_all('tr')[4])
type(soup.find(id='tblFlightData').find_all('tr')[4])
e = soup.find(id='tblFlightData').find_all('tr')[4]
e
e.td
e.td
e.attrs
e.children
e
e.sttrs
e.attrs
e.decompose
e.decompose()
e
e = soup.find(id='tblFlightData').find_all('tr')[4]
e.attrs
e.find_all('td')
dir(e.find_all('td')[1])
(e.find_all('td')[1]).attrs
(e.find_all('td')[1]).text
(e.find_all('td')[1])
(e.find_all('td'))