Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. JavaIsNotHard created this gist Jul 9, 2023.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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)