Scrapy get all links from any website
问题 I have the following code for a web crawler in Python 3: import requests from bs4 import BeautifulSoup import re def get_links(link): return_links = [] r = requests.get(link) soup = BeautifulSoup(r.content, "lxml") if r.status_code != 200: print("Error. Something is wrong here") else: for link in soup.findAll('a', attrs={'href': re.compile("^http")}): return_links.append(link.get('href'))) def recursive_search(links) for i in links: links.append(get_links(i)) recursive_search(links) recursive