当前位置:网站首页>All tutor information on one page
All tutor information on one page
2022-06-27 07:50:00 【Supernatural prayer】
Find a teacher , They don't want to be half full-time , alas , Do I have to sift the direction of my tutor again ……
I won't pour any emotion into you if you are ruthless ,python Walk up

The calculator adds the number of people on the right , in total 309, I focus on achieving my goals , You don't need all the code , So I first crawled through all the links with names

See a label , But what you need xpath, I simply use the most convenient regular box to select
# -*- coding: utf-8 -*-
import os
import os.path
import requests
import re
import csv
URL="https://aipt.ucas.ac.cn/index.php/zh-cn/jsdw/graduateteacher"
res = requests.get(URL)
REX = "http://.*?\""
print(res)
ls = re.findall(REX, res.text)
#" target="_blank"
with open('res.csv', mode='a', newline='', encoding='utf-8-sig') as f:
csv_writer = csv.writer(f, delimiter=',')
csv_writer.writerow([ls])ok , Just after the execution 309 individual , The following seems to be repeated again , Delete

Facing the newly stored res.csv And then repeat the old technique , Put it away text The content is stored in another corresponding res1.scv in , I'll use wps Find the keywords you are interested in and find the teacher .
( Be careful , hold \n Replace , It's a pit , Otherwise text Returns an empty , For two hours )
# -*- coding: utf-8 -*-
import os
import os.path
import requests
import re
import csv
lines=[]
with open('E:\\1projects\\PY\\PY\\res.csv','r') as f:
lines=f.readlines()
for line in lines:
str = line
str = str.replace("\n","") # Replace \n
print(str)
res = requests.get(str)
print(res)
#print(res.text)
with open('res1.csv', mode='a', newline='', encoding='utf-8-sig') as f:
csv_writer = csv.writer(f, delimiter=',')
csv_writer.writerow([line,res.text])
print("done")direct wps Filter and filter , Then click on his homepage to see

边栏推荐
- 【批处理DOS-CMD命令-汇总和小结】-输出/显示命令——echo
- (note) Anaconda navigator flashback solution
- 八大误区,逐个击破(终篇):云难以扩展、定制性差,还会让管理员失去控制权?
- [compilation principles] review outline of compilation principles of Shandong University
- 【10. 差分】
- Sword finger offer 07 Rebuild binary tree
- js判断用户输入的数是否为质数(多种方法)
- How to view program running time (timer) in JS
- Origin of forward slash and backslash
- MSSQL how to export and delete multi table data using statements
猜你喜欢
随机推荐
R language consumption behavior statistics based on association rules and cluster analysis
Etcd教程 — 第五章 Etcd之etcdctl的使用
大厂工作十年,年薪40万突然被裁员,公司想抛弃你,一分情面都不会留
cookie加密7 fidder分析阶段
The 6th Blue Bridge Cup
无论LCD和OLED显示技术有多好,都无法替代这个古老的显示数码管
University database mysql
js中如何查看程序运行时间(计时器)
Index +sql exercise optimization
【批处理DOS-CMD命令-汇总和小结】-输出/显示命令——echo
[Kevin's third play in a row] is rust really slower than C? Further analyze queen micro assessment
js中输入三个值,并且由小到大输出
JDBC operation MySQL example
js用switch语句根据1-7输出对应英文星期几
VNC Viewer方式的远程连接树莓派
Remote connection raspberry pie in VNC Viewer Mode
基础知识 | js基础
第6届蓝桥杯
【10. 差分】
突破从0到1后,鲜花电商2.0时代怎么走?








