从页面获取网址[关闭]

问题描述 投票:0回答:1

我如何从这个网站获取每个商店的网址: https://maroof.sa/businesses/

我尝试了很多东西但无法得到它们

python beautifulsoup scrapy
1个回答
-1
投票
import requests
from bs4 import BeautifulSoup

def get_content(url):

    response = requests.get(url)
    html_content = response.text

    soup = BeautifulSoup(html_content, 'html.parser')

    # Here you have to write code to retrieve information from html 

    return soup

if __name__ == '__main__':
    url = 'https://maroof.sa/businesses/details/229217'
    get_content(url)    
© www.soinside.com 2019 - 2024. All rights reserved.