BeautifulSoup to scrape street address

前端 未结 1 438
北荒
北荒 2021-01-29 09:40

I am using the code at the far bottom to get weblink, and the Masjid name. however I would like to also get denomination and <

相关标签:
1条回答
  • 2021-01-29 09:59

    You can check next <div> element with a class attribute with value tinyLink and that contains either a <b> and a <br> tags and extract their strings:

    ...
    print pos 
    div = result.find_next_sibling('div', attrs={"class": "tinyLink"})
    if div and div.b and div.br:
        print(div.b.next_sibling.string)
        print(div.br.next_sibling.string)
    
    0 讨论(0)
提交回复
热议问题