page = urllib2.urlopen('https://www.sec.gov/Archives/edgar/data/1591890/0001493152-18-003887-index.htm').read()
soup = BeautifulSoup(page)
soup.prettify()
# page = requests.get('https://www.sec.gov/Archives/edgar/data/1591890/0001493152-18-003887-index.htm')
# soup = BeautifulSoup(page, 'html.parser')
# Remove bottom links
for link in soup.findAll('a', href=True,text = re.compile('instance')):
print link['href']
我没有得到任何运行此链接
您只需修改soup调用即可获得findAll()返回的字典的“href”键。这应该可以满足您的需要:
相关问题 更多 >
编程相关推荐