Python爬虫:isinstance()函数
https://www.runoob.com/python/python-func-isinstance.html
应用场景:
爬虫进行数据采集时,去除不适合的内容。
例如
for tr in soup.find('tbody').children:
if isinstance(tr, bs4.element.Tag):
tds = tr('td')
https://www.runoob.com/python/python-func-isinstance.html
应用场景:
爬虫进行数据采集时,去除不适合的内容。
例如
for tr in soup.find('tbody').children:
if isinstance(tr, bs4.element.Tag):
tds = tr('td')