使用python从网站中删除广告网址

时间:2020-08-18 08:28:01

标签: python web-scraping beautifulsoup python-requests lxml

主题:使用bs4抓取网站

问题:我需要从网站中提取广告网址。 我从网站上提取了所有链接,但找不到包含该广告的网站上的任何广告链接

我的代码:

from bs4 import BeautifulSoup
import requests

source = requests.get('https://www.premiumswat.me').text

soup = BeautifulSoup(source , 'lxml')

for link in soup.find_all('a' , href = True):
    print(link['href'])

0 个答案:

没有答案
相关问题