代码:
# function - send a get request to each url
def send_get_request(link, search_for):
try:
html = send_request = requests.get(link)
for i in search_for:
if any(i in html.text for i in search_for):
return link
else:
return False
except Exception as e:
print("Error: " + str(e))
# search for any of these items
search_for = ['about me', 'home page']
在“我的搜索”中查找列表项时,如果找到“关于的一词,则将其标记为成功。我需要找到关于我的完整单词,就像主页和主页一样。你知道吗
使用
re.findall
相关问题 更多 >
编程相关推荐