|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- import re
- import requests as r
- from bs4 import BeautifulSoup
- import json
- from tqdm import tqdm
- # 1. 发送请求,获取首页
- response = r.get("https://www.yooc.me/group/2694692/exam/191841/detail")
- json_str = response.content.decode()
- print(json_str)
- # 2. 解析数据,提取目标字符串
- # 3. 保存数据为json文件
复制代码- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>维护ing</title>
- <style>
- body {
- margin: 0;
- font-family: "Microsoft YaHei", "STHeiti", Helvetica, Arial, sans-serif;
- font-size: 16px;
- color: #455a64;
- }
- a {
- color: #07a9ea;
- text-decoration: none;
- }
- strong {
- color: #07a9ea;
- }
- h1 {
- font-size: 30px;
- }
- p {
- line-height: 1.5;
- }
- .container {
- width: 720px;
- margin: 8em auto;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <h1>
- 亲爱的易友:
- </h1>
- <p>
- 当前用户过多,请刷新一下页面,再试一下,谢谢。
- <br><br>
- 给您带来不便敬请谅解!
- </p >
- </div>
-
- </body>
- </html>
复制代码
说一下我的思路,通过访问网页,进入练习,然后然后全选第一个选项,提交试卷,查看答案解析,提取解析界面源代码中的题目和答案,判断是否在题目库中,没有则保存为json文件.重复以上步骤,遍历题库.现在卡在了第一步,不管试几次都是这个!!! |
|