
如 http://guba.eastmoney.com/list,600519.html
要开始学些什么。。
1 soho176 Oct 10, 2019 python 正则,再或者简单的办法 火车头 直接抓取 |
2 di1012 Oct 10, 2019 正则匹配,xpath |
3 biu7 Oct 10, 2019 |
4 None123 Oct 10, 2019 requests 获取网页 xpath / re 解析 |
5 silencefent Oct 10, 2019 //div[@id='articlelistnew']//div/span[@class="l1 a1"] |
6 yellowtail OP 还是不太明白,,用过 selenium,通过 findbyname 定位到“一个”标签,然后输入用户民密码,登录,refresh。。给论坛刷积分 但是这种的没看出来怎么定位到“一个”。。。各位大佬能不能简单写个栗子 主要想学会怎么看这个问题 |
7 yellowtail OP @silencefent 这可以拿出来第一页的全部目标元素吗... |
8 None123 Oct 10, 2019 |
9 lspvic Oct 10, 2019 via Android 爬虫可以看看有没有对应的移动版网页,网页简洁许多,好解析,速度快,效率高,甚至有些直接有 api 可用 |
10 yellowtail @None123 全部阅读数应该是自己一个一个的加。。这样拿到的是一个数组吗 |
11 None123 Oct 10, 2019 @yellowtail 什么意思? |
12 houzhimeng Oct 10, 2019 from bs4 import BeautifulSoup import requests html = "http://guba.eastmoney.com/list,600519.html" r = requests.get(html).content soup = BeautifulSoup(r,"lxml") yuedu = soup.find_all('span',{'class':'l1 a1'}) for i in yuedu: print(i.get_text()) |
13 yellowtail OP @houzhimeng 感谢 |