From 8b7b133be71b1ca1ee863ea747b56f4996162f58 Mon Sep 17 00:00:00 2001 From: p2tfsuw8f <2517759664@qq.com> Date: Mon, 25 Apr 2022 20:02:08 +0800 Subject: [PATCH] Update getdata.py --- getdata.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/getdata.py b/getdata.py index e69de29..d75e155 100644 --- a/getdata.py +++ b/getdata.py @@ -0,0 +1,13 @@ +import csv +import requests +import re, os +from bs4 import BeautifulSoup + +url = ' https://mp.weixin.qq.com/s/K0u_qPFQtWuH4hk5K2xWfQ' +response = requests.get(url) +response.encoding = response.apparent_encoding +response.encoding = 'utf-8' +html = response.text +soup = BeautifulSoup(html, 'html.parser') +ans = soup.select('div.rich_media > div.rich_media_inner ') +ans1 = ans[0].text.encode() \ No newline at end of file