2024-06-16 11:12:02 发布
网友
for lnk in soup.find_all('a', attrs={'href': re.compile('.+')}): for lnk in soup.find_all('a', attrs={'onclick': re.compile('.+')}):
如何选择所有这些具有href not empty或onclick attr的标记
soup.find_all(lambda tag: tag.name == "a" and (tag.has_attr("onclick") or len(tag["href"]) > 0))
相关问题 更多 >
编程相关推荐