我正在使用BeautifulSoup从此网站https://lawyers.justia.com/lawyer/michael-paul-ehline-85006抓取>
我不希望在输出中显示赞助商清单:
我的代码:
for o in soup.findAll('div', attrs={"class": "block-wrapper"}): for de in o.findAll("li"): if de != []: de=remove_tags(str(de)) print (de)
python输出:OUTPUT IMAGE
我正在使用BeautifulSoup从此网站上抓取https://lawyers.justia.com/lawyer/michael-paul-ehline-85006我不希望在我的输出中显示赞助商清单:我的代码:用于汤中的o。 ...
您可以删除HTML页面中的内容。使用findAll('div',attrs = {“ class”:“ primary-sidebar-wrapper”})找到所需的元素后。您可以执行以下操作: