【发布时间】:2018-07-07 17:17:07
【问题描述】:
我想使用 9gag 的图片和该图片的前 10 个 cmets。我正在尝试使用 python 提取图像。我不知道该怎么做。
BASE_URL = 'https://9gag.com/'
def get_image_soup(section):
url = BASE_URL + section
source_code = requests.get(url)
plain_text = source_code.text
soup = bs(plain_text)
return soup
soup = get_image_soup(BASE_URL + 'funny')
看起来文章的链接在“GAG.App.LoadConfig”中。如何拉取文章的链接?
【问题讨论】:
标签: python html json web-scraping automation