Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JavaIsNotHard/ddcf9cc6fb19cc6a2dec637f07eb6175 to your computer and use it in GitHub Desktop.
Save JavaIsNotHard/ddcf9cc6fb19cc6a2dec637f07eb6175 to your computer and use it in GitHub Desktop.
python
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen('https://merolagani.com/LatestMarket.aspx')
bs = BeautifulSoup(html.read(), 'html.parser')
namelist = bs.find('div', {'id': 'ctl00_ContentPlaceHolder1_LiveTrading'})
childtag = namelist.find('table')
childchildtag = childtag.find('tbody')
gettrtag = childchildtag.find_all('tr')
for elements in gettrtag:
tdtag = elements.find_all('td')
for td in tdtag:
if not td.text.isspace():
print(td.text)
@Elaidybasem32
Copy link

Very good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment