网址源码如下:
<span class="company-page-item-right cmpweb">
<a target="_blank" href="http://www.gmgitc.com">www.gmgitc.com</a>
</span>
通过BS解析后,无法获取a标签内容
import requests
from bs4 import BeautifulSoup
intro_url = 'https://xinsanban.eastmoney.com/F10/CompanyInfo/Introduction/831039.html'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\
/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36'}
resp = requests.get(intro_url, headers=headers, timeout=1)
print(bs)
___________________________________________________________________________________________________
<li class="even">
<span class="company-page-item-left ">公司网址</span>
<span class="company-page-item-right cmpweb"/>
</li>