吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2338|回复: 12
收起左侧

[求助] 求助python爬东方财富数据问题

[复制链接]
jackyjiam 发表于 2022-2-19 21:26
本帖最后由 jackyjiam 于 2022-2-20 09:04 编辑

在网上找到一段代码运行没问题,换了请求地址和部分参数修改后代码无法运行,编程小白,各位大神帮忙看看哈






修改代码-无法运行

import time
from openpyxl import Workbook
from lxml import etree
from selenium import webdriver

def main():
url = r'https://data.eastmoney.com/report/stock.jshtml'
wb = Workbook()
sheet = wb.active
sheet.append(['序号','股票代码','股票简称','相关','报告名称','东财评级','评级变动','机构','近一月个股研报数','2021盈利预测收益','2021盈利预测市盈率','2022盈利预测收益','2022盈利预测市盈率','行业','日期'])

dirver = webdriver.Chrome(executable_path=r'D:\python\chromedriver.exe')
dirver.get(url)
count = 1
while True:
    response = dirver.page_source
    html_str = etree.HTML(response)
    for i in range(1,51):
        odd = html_str.xpath(r'//*[@id="stock_table"]/tbody/tr[{}]//text()'.format(i))
        del odd[3:8]
        sheet.append(odd)
    print('******正在下载{}页数据******'.format(count))
    time.sleep(5)
    dirver.find_element_by_xpath(r'//*[@id="stock_table_pager"]/a[2]').click()
    count += 1
    time.sleep(5)
    if count == 1:
        break
wb.save('东方财富网信息采集.xlsx')
print('****全部数据下载完成****')

if name == 'main':
main()

正常代码-可以运行

import time
from openpyxl import Workbook
from lxml import etree
from selenium import webdriver

def main():
url = r'http://quote.eastmoney.com/center/gridlist.html#hs_a_board'
wb = Workbook()
sheet = wb.active
sheet.append(['序号','代码','名称','最新价','涨跌幅','涨跌额','成交量(手)','成交额','振幅','最高','最低','今开','昨收','量比','换手率','市盈率(动态)','市净率'])
dirver = webdriver.Chrome(executable_path=r'D:\python\chromedriver.exe')
dirver.get(url)
count = 1
while True:
response = dirver.page_source
html_str = etree.HTML(response)
for i in range(1,21):
odd = html_str.xpath(r'//*[@id="table_wrapper-table"]/tbody/tr[{}]//text()'.format(i))
del odd[3:8]
sheet.append(odd)
print('**正在下载{}页数据**'.format(count))
time.sleep(5)
dirver.find_element_by_xpath(r'//*[@id="main-table_paginate"]/a[2]').click()
count += 1
time.sleep(5)
if count == 4:
break
wb.save('东方财富网信息采集.xlsx')
print('全部数据下载完成')

if name == 'main':
main()

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

PeppaPig 发表于 2022-2-20 00:06
[Python] 纯文本查看 复制代码
if name == 'main':改成if __name__ =="__main__":

然后把报错提示发一下
三滑稽甲苯 发表于 2022-2-20 08:26
 楼主| jackyjiam 发表于 2022-2-20 08:58
PeppaPig 发表于 2022-2-20 00:06
然后把报错提 ...

D:\python\python.exe D:/data/pa/test.py
D:/data/pa/test.py:14: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  dirver = webdriver.Chrome(executable_path=r'D:\python\chromedriver.exe')
******正在下载1页数据******
D:/data/pa/test.py:26: DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
  dirver.find_element_by_xpath(r'//*[@id="stock_table_pager"]/a[2]').click()
Traceback (most recent call last):
  File "D:/data/pa/test.py", line 36, in <module>
    main()
  File "D:/data/pa/test.py", line 26, in main
    dirver.find_element_by_xpath(r'//*[@id="stock_table_pager"]/a[2]').click()
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 520, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1246, in find_element
    'value': value})['value']
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="stock_table_pager"]/a[2]"}
  (Session info: chrome=98.0.4758.102)
Stacktrace:
Backtrace:
        Ordinal0 [0x006469A3+2582947]
        Ordinal0 [0x005DA6D1+2139857]
        Ordinal0 [0x004D3A98+1063576]
        Ordinal0 [0x004FFF3E+1244990]
        Ordinal0 [0x0050013B+1245499]
        Ordinal0 [0x00529F52+1417042]
        Ordinal0 [0x00518594+1344916]
        Ordinal0 [0x0052834A+1409866]
        Ordinal0 [0x00518366+1344358]
        Ordinal0 [0x004F5176+1200502]
        Ordinal0 [0x004F6066+1204326]
        GetHandleVerifier [0x007EBE02+1675858]
        GetHandleVerifier [0x008A036C+2414524]
        GetHandleVerifier [0x006DBB01+560977]
        GetHandleVerifier [0x006DA8D3+556323]
        Ordinal0 [0x005E020E+2163214]
        Ordinal0 [0x005E5078+2183288]
        Ordinal0 [0x005E51C0+2183616]
        Ordinal0 [0x005EEE1C+2223644]
        BaseThreadInitThunk [0x771CFA29+25]
        RtlGetAppContainerNamedObjectPath [0x773F7A9E+286]
        RtlGetAppContainerNamedObjectPath [0x773F7A6E+238]


Process finished with exit code 1


兄好,页面已经调出来了,看情况应该是处理标签时出错了吧?
唯爱丶雪 发表于 2022-2-20 09:45
dirver.find_element(By.XPATH, r'//*[@id="stock_table_pager"]/a[2]').click()
 楼主| jackyjiam 发表于 2022-2-20 11:14
唯爱丶雪 发表于 2022-2-20 09:45
dirver.find_element(By.XPATH, r'//*[@id="stock_table_pager"]/a[2]').click()

<div id="stock_table" style="position: relative;"><table class="table-model" style="background-color: rgb(246, 244, 236);"><thead><tr><th rowspan="2">序号</th><th width="60px" data-name="stockCode" rowspan="2"><a target="_self" href="javascript:;">股票代码</a></th><th width="60px" rowspan="2">股票简称</th><th width="60px" rowspan="2">相关</th><th width="150px" rowspan="2">报告名称</th><th rowspan="2">东财<br>评级</th><th rowspan="2">评级<br>变动</th><th width="70px" rowspan="2">机构</th><th data-name="count" rowspan="2">近一月<br>个股研<br>报数</th><th colspan="2">2021盈利预测</th><th colspan="2">2022盈利预测</th><th width="60px" rowspan="2">行业</th><th width="65px" data-name="publishDate" rowspan="2"><a target="_self" href="javascript:;">日期</a></th></tr><tr style="background-color: rgb(246, 244, 236);"><th data-name="predictThisYearEps"><a target="_self" href="javascript:;">收益</a></th><th data-name="predictThisYearPe"><a target="_self" href="javascript:;">市盈率</a></th><th data-name="predictNextYearEps"><a target="_self" href="javascript:;">收益</a></th><th data-name="predictNextYearPe"><a target="_self" href="javascript:;">市盈率</a></th></tr></thead><tbody><tr><td>1</td><td><a href="//quote.eastmoney.com/unify/r/0.002505">002505</a></td><td><a href="/stockdata/002505.html">鹏都农牧</a></td><td><a href="/report/002505.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002505.html">股吧</a></td><td><a href="/report/info/AP202202191547951028.html">深耕产业链一体化,肉牛巨轮乘风起航</a></td><td>增持</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000048">华西证券</a></td><td>1</td><td>0.020</td><td>184.07</td><td>0.070</td><td>50.21</td><td><a href="/report/industry.jshtml?hyid=484">贸易行业</a></td><td>2022-02-20</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>2</td><td><a href="//quote.eastmoney.com/unify/r/1.600480">600480</a></td><td><a href="/stockdata/600480.html">凌云股份</a></td><td><a href="/report/600480.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,600480.html">股吧</a></td><td><a href="/report/info/AP202202181547781373.html">品类客户拓展顺利,电池壳业务空间广阔</a></td><td>增持</td><td>-</td><td><a href="/report/orgpublish.jshtml?orgcode=80000051">南京证券</a></td><td>2</td><td>0.360</td><td>25.52</td><td>0.460</td><td>19.66</td><td><a href="/report/industry.jshtml?hyid=1018">橡胶制品</a></td><td>2022-02-18</td></tr><tr><td>3</td><td><a href="//quote.eastmoney.com/unify/r/1.600096">600096</a></td><td><a href="/stockdata/600096.html">云天化</a></td><td><a href="/report/600096.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,600096.html">股吧</a></td><td><a href="/report/info/AP202202181547781365.html">事件点评:携手各行业龙头,打造新能源电池全产业链集群</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=10001055">国海证券</a></td><td>2</td><td>1.970</td><td>10.81</td><td>2.190</td><td>9.75</td><td><a href="/report/industry.jshtml?hyid=731">化肥行业</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>4</td><td><a href="//quote.eastmoney.com/unify/r/1.605123">605123</a></td><td><a href="/stockdata/605123.html">派克新材</a></td><td><a href="/report/605123.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,605123.html">股吧</a></td><td><a href="/report/info/AP202202181547781364.html">公司简评报告:下游需求放量,业绩高速增长</a></td><td>增持</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000122">首创证券</a></td><td>3</td><td>2.820</td><td>45.40</td><td>3.910</td><td>32.70</td><td><a href="/report/industry.jshtml?hyid=545">通用设备</a></td><td>2022-02-18</td></tr><tr><td>5</td><td><a href="//quote.eastmoney.com/unify/r/0.002410">002410</a></td><td><a href="/stockdata/002410.html">广联达</a></td><td><a href="/report/002410.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002410.html">股吧</a></td><td><a href="/report/info/AP202202181547779780.html">再谈广联达:当前时点下如何看待其三条增长曲线</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000157">中泰证券</a></td><td>9</td><td>0.550</td><td>103.00</td><td>0.830</td><td>69.00</td><td><a href="/report/industry.jshtml?hyid=737">软件开发</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>6</td><td><a href="//quote.eastmoney.com/unify/r/0.002049">002049</a></td><td><a href="/stockdata/002049.html">紫光国微</a></td><td><a href="/report/002049.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002049.html">股吧</a></td><td><a href="/report/info/AP202202181547779779.html">特种集成电路领军企业,业绩有望持续超预期</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000157">中泰证券</a></td><td>1</td><td>3.330</td><td>59.00</td><td>4.890</td><td>40.00</td><td><a href="/report/industry.jshtml?hyid=1036">半导体</a></td><td>2022-02-18</td></tr><tr><td>7</td><td><a href="//quote.eastmoney.com/unify/r/1.603260">603260</a></td><td><a href="/stockdata/603260.html">合盛硅业</a></td><td><a href="/report/603260.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603260.html">股吧</a></td><td><a href="/report/info/AP202202181547779778.html">公告点评:投建20万吨多晶硅产能,硅基龙头拓宽产业布局</a></td><td>增持</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000074">光大证券</a></td><td>1</td><td>8.060</td><td>15.00</td><td>9.670</td><td>12.00</td><td><a href="/report/industry.jshtml?hyid=1020">非金属材料</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>8</td><td><a href="//quote.eastmoney.com/unify/r/0.000792">000792</a></td><td><a href="/stockdata/000792.html">盐湖股份</a></td><td><a href="/report/000792.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,000792.html">股吧</a></td><td><a href="/report/info/AP202202181547777769.html">首次覆盖报告:钾肥巨头重回归,聚焦钾锂迎增长</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80560358">东亚前海证券</a></td><td>3</td><td>0.750</td><td>41.61</td><td>1.290</td><td>24.15</td><td><a href="/report/industry.jshtml?hyid=731">化肥行业</a></td><td>2022-02-18</td></tr><tr><td>9</td><td><a href="//quote.eastmoney.com/unify/r/0.002212">002212</a></td><td><a href="/stockdata/002212.html">天融信</a></td><td><a href="/report/002212.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002212.html">股吧</a></td><td><a href="/report/info/AP202202181547777768.html">公司点评报告:主业实现行业领涨,但产品结构变化、原材料短缺拖累Q4整体盈利能力</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000218">中原证券</a></td><td>1</td><td>0.350</td><td>42.05</td><td>0.810</td><td>18.10</td><td><a href="/report/industry.jshtml?hyid=737">软件开发</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>10</td><td><a href="//quote.eastmoney.com/unify/r/0.300993">300993</a></td><td><a href="/stockdata/300993.html">玉马遮阳</a></td><td><a href="/report/300993.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,300993.html">股吧</a></td><td><a href="/report/info/AP202202181547766384.html">深度报告:功能遮阳前景广阔,龙头玉马未来可期</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80092742">信达证券</a></td><td>1</td><td>1.080</td><td>25.27</td><td>1.380</td><td>19.65</td><td><a href="/report/industry.jshtml?hyid=725">装修装饰</a></td><td>2022-02-18</td></tr><tr><td>11</td><td><a href="//quote.eastmoney.com/unify/r/0.300065">300065</a></td><td><a href="/stockdata/300065.html">海兰信</a></td><td><a href="/report/300065.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,300065.html">股吧</a></td><td><a href="/report/info/AP202202181547752807.html">数字新基建前景广阔,海底数据中心海南示范项目开工</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80050806">太平洋</a></td><td>2</td><td>0.120</td><td>114.57</td><td>0.290</td><td>47.15</td><td><a href="/report/industry.jshtml?hyid=448">通信设备</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>12</td><td><a href="//quote.eastmoney.com/unify/r/1.688595">688595</a></td><td><a href="/stockdata/688595.html">芯海科技</a></td><td><a href="/report/688595.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,688595.html">股吧</a></td><td><a href="/report/info/AP202202181547752805.html">MCU+ADC双平台蓄力,AIOT扎实推进</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=10000296">西南证券</a></td><td>1</td><td>0.930</td><td>102.56</td><td>1.920</td><td>49.63</td><td><a href="/report/industry.jshtml?hyid=1036">半导体</a></td><td>2022-02-18</td></tr><tr><td>13</td><td><a href="//quote.eastmoney.com/unify/r/1.688300">688300</a></td><td><a href="/stockdata/688300.html">联瑞新材</a></td><td><a href="/report/688300.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,688300.html">股吧</a></td><td><a href="/report/info/AP202202181547752804.html">受益于电子材料国产化的硅微粉龙头</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000064">华安证券</a></td><td>1</td><td>2.060</td><td>45.79</td><td>2.820</td><td>33.50</td><td><a href="/report/industry.jshtml?hyid=1020">非金属材料</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>14</td><td><a href="//quote.eastmoney.com/unify/r/0.002916">002916</a></td><td><a href="/stockdata/002916.html">深南电路</a></td><td><a href="/report/002916.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002916.html">股吧</a></td><td><a href="/report/info/AP202202181547752802.html">黄金赛道维持增长,封装基板打造成长新核心</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000064">华安证券</a></td><td>2</td><td>2.960</td><td>37.82</td><td>3.810</td><td>29.37</td><td><a href="/report/industry.jshtml?hyid=459">电子元件</a></td><td>2022-02-18</td></tr><tr><td>15</td><td><a href="//quote.eastmoney.com/unify/r/0.002949">002949</a></td><td><a href="/stockdata/002949.html">华阳国际</a></td><td><a href="/report/002949.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002949.html">股吧</a></td><td><a href="/report/info/AP202202181547752801.html">携手中望软件加码BIM研发,科技转型再下一城</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000124">天风证券</a></td><td>2</td><td>0.510</td><td>35.65</td><td>1.270</td><td>14.41</td><td><a href="/report/industry.jshtml?hyid=726">工程咨询服务</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>16</td><td><a href="//quote.eastmoney.com/unify/r/1.603063">603063</a></td><td><a href="/stockdata/603063.html">禾望电气</a></td><td><a href="/report/603063.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603063.html">股吧</a></td><td><a href="/report/info/AP202202181547752799.html">投资价值分析报告:聚焦电能变换与控制,打造风光储核心竞争力</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000074">光大证券</a></td><td>2</td><td>0.550</td><td>68.00</td><td>1.010</td><td>37.00</td><td><a href="/report/industry.jshtml?hyid=1032">风电设备</a></td><td>2022-02-18</td></tr><tr><td>17</td><td><a href="//quote.eastmoney.com/unify/r/0.002438">002438</a></td><td><a href="/stockdata/002438.html">江苏神通</a></td><td><a href="/report/002438.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002438.html">股吧</a></td><td><a href="/report/info/AP202202181547752770.html">拟收购德维股份,增加产业协同,发展再上新台阶</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000124">天风证券</a></td><td>1</td><td>0.600</td><td>25.61</td><td>0.790</td><td>19.40</td><td><a href="/report/industry.jshtml?hyid=545">通用设备</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>18</td><td><a href="//quote.eastmoney.com/unify/r/0.002405">002405</a></td><td><a href="/stockdata/002405.html">四维图新</a></td><td><a href="/report/002405.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002405.html">股吧</a></td><td><a href="/report/info/AP202202181547745765.html">从地图商业模式变迁看【四维图新】价值!</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000048">华西证券</a></td><td>1</td><td>0.050</td><td>338.82</td><td>0.170</td><td>95.00</td><td><a href="/report/industry.jshtml?hyid=737">软件开发</a></td><td>2022-02-18</td></tr><tr><td>19</td><td><a href="//quote.eastmoney.com/unify/r/0.301206">301206</a></td><td><a href="/stockdata/301206.html">三元生物</a></td><td><a href="/report/301206.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,301206.html">股吧</a></td><td><a href="/report/info/AP202202181547737899.html">公司首次覆盖报告:无糖赛道优质,龙头风范尽显</a></td><td>增持</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000162">开源证券</a></td><td>1</td><td>3.940</td><td>28.70</td><td>5.660</td><td>20.00</td><td><a href="/report/industry.jshtml?hyid=438">食品饮料</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>20</td><td><a href="//quote.eastmoney.com/unify/r/1.603927">603927</a></td><td><a href="/stockdata/603927.html">中科软</a></td><td><a href="/report/603927.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603927.html">股吧</a></td><td><a href="/report/info/AP202202181547737898.html">公司首次覆盖报告:保险信创龙头,迎来加速发展期</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000162">开源证券</a></td><td>1</td><td>0.980</td><td>31.00</td><td>1.280</td><td>23.70</td><td><a href="/report/industry.jshtml?hyid=737">软件开发</a></td><td>2022-02-18</td></tr><tr><td>21</td><td><a href="//quote.eastmoney.com/unify/r/1.603078">603078</a></td><td><a href="/stockdata/603078.html">江化微</a></td><td><a href="/report/603078.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603078.html">股吧</a></td><td><a href="/report/info/AP202202181547737897.html">国内湿电子化学品领军企业,新产能释放未来可期</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000064">华安证券</a></td><td>1</td><td>0.250</td><td>98.20</td><td>0.670</td><td>37.30</td><td><a href="/report/industry.jshtml?hyid=1039">电子化学品</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>22</td><td><a href="//quote.eastmoney.com/unify/r/1.600480">600480</a></td><td><a href="/stockdata/600480.html">凌云股份</a></td><td><a href="/report/600480.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,600480.html">股吧</a></td><td><a href="/report/info/AP202202181547737594.html">公司首次覆盖报告:轻量化业务加速布局,电池壳产品打开成长空间</a></td><td>买入</td><td>调高</td><td><a href="/report/orgpublish.jshtml?orgcode=80000162">开源证券</a></td><td>2</td><td>0.360</td><td>24.90</td><td>0.510</td><td>17.80</td><td><a href="/report/industry.jshtml?hyid=1018">橡胶制品</a></td><td>2022-02-18</td></tr><tr><td>23</td><td><a href="//quote.eastmoney.com/unify/r/1.688107">688107</a></td><td><a href="/stockdata/688107.html">安路科技</a></td><td><a href="/report/688107.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,688107.html">股吧</a></td><td><a href="/report/info/AP202202181547730459.html">快速崛起的国内FPGA龙头</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=10001055">国海证券</a></td><td>1</td><td>-0.090</td><td></td><td>-0.010</td><td></td><td><a href="/report/industry.jshtml?hyid=1036">半导体</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>24</td><td><a href="//quote.eastmoney.com/unify/r/0.300408">300408</a></td><td><a href="/stockdata/300408.html">三环集团</a></td><td><a href="/report/300408.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,300408.html">股吧</a></td><td><a href="/report/info/AP202202181547730158.html">一体化电子陶瓷龙头,MLCC打开成长空间</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000064">华安证券</a></td><td>1</td><td>1.110</td><td>37.40</td><td>1.400</td><td>29.90</td><td><a href="/report/industry.jshtml?hyid=459">电子元件</a></td><td>2022-02-18</td></tr><tr><td>25</td><td><a href="//quote.eastmoney.com/unify/r/0.002376">002376</a></td><td><a href="/stockdata/002376.html">新北洋</a></td><td><a href="/report/002376.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002376.html">股吧</a></td><td><a href="/report/info/AP202202181547730156.html">受益数字货币,企稳回升可待</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000200">中银证券</a></td><td>1</td><td>0.260</td><td>32.80</td><td>0.407</td><td>21.00</td><td><a href="/report/industry.jshtml?hyid=735">计算机设备</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>26</td><td><a href="//quote.eastmoney.com/unify/r/1.601117">601117</a></td><td><a href="/stockdata/601117.html">中国化学</a></td><td><a href="/report/601117.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,601117.html">股吧</a></td><td><a href="/report/info/AP202202181547710809.html">1月订单高增83%,新材料业务进展顺利</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000214">国盛证券</a></td><td>1</td><td>0.690</td><td>15.50</td><td>1.060</td><td>10.10</td><td><a href="/report/industry.jshtml?hyid=425">工程建设</a></td><td>2022-02-18</td></tr><tr><td>27</td><td><a href="//quote.eastmoney.com/unify/r/0.002949">002949</a></td><td><a href="/stockdata/002949.html">华阳国际</a></td><td><a href="/report/002949.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002949.html">股吧</a></td><td><a href="/report/info/AP202202181547710805.html">联合中望共研平台软件,BIM业务未来可期</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000214">国盛证券</a></td><td>2</td><td>0.540</td><td>34.00</td><td>1.290</td><td>14.20</td><td><a href="/report/industry.jshtml?hyid=726">工程咨询服务</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>28</td><td><a href="//quote.eastmoney.com/unify/r/1.600299">600299</a></td><td><a href="/stockdata/600299.html">安迪苏</a></td><td><a href="/report/600299.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,600299.html">股吧</a></td><td><a href="/report/info/AP202202181547705606.html">2021年度业绩快报点评:蛋氨酸销售持续增长,21年业绩稳步提升</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000074">光大证券</a></td><td>1</td><td>0.550</td><td>23.00</td><td>0.600</td><td>20.00</td><td><a href="/report/industry.jshtml?hyid=538">化学制品</a></td><td>2022-02-18</td></tr><tr><td>29</td><td><a href="//quote.eastmoney.com/unify/r/1.603338">603338</a></td><td><a href="/stockdata/603338.html">浙江鼎力</a></td><td><a href="/report/603338.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603338.html">股吧</a></td><td><a href="/report/info/AP202202181547703773.html">Higher-than-expected anti-dumping duties but overhang largely removed</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80027629">招银国际</a></td><td>2</td><td>1.920</td><td></td><td>2.340</td><td></td><td><a href="/report/industry.jshtml?hyid=739">工程机械</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>30</td><td><a href="//quote.eastmoney.com/unify/r/1.688083">688083</a></td><td><a href="/stockdata/688083.html">中望软件</a></td><td><a href="/report/688083.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,688083.html">股吧</a></td><td><a href="/report/info/AP202202181547701550.html">与华阳国际设立合资公司,强强联合打开BIM市场</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000124">天风证券</a></td><td>5</td><td>2.910</td><td>92.25</td><td>4.080</td><td>65.78</td><td><a href="/report/industry.jshtml?hyid=737">软件开发</a></td><td>2022-02-18</td></tr><tr><td>31</td><td><a href="//quote.eastmoney.com/unify/r/1.688556">688556</a></td><td><a href="/stockdata/688556.html">高测股份</a></td><td><a href="/report/688556.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,688556.html">股吧</a></td><td><a href="/report/info/AP202202181547700462.html">高硬脆材料切割先锋,技术体系形成闭环</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=10000296">西南证券</a></td><td>3</td><td>0.980</td><td>62.55</td><td>2.130</td><td>28.68</td><td><a href="/report/industry.jshtml?hyid=1031">光伏设备</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>32</td><td><a href="//quote.eastmoney.com/unify/r/0.001215">001215</a></td><td><a href="/stockdata/001215.html">千味央厨</a></td><td><a href="/report/001215.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,001215.html">股吧</a></td><td><a href="/report/info/AP202202181547696568.html">系列报告之一:双轮齐增长,央厨供四方</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80114781">东兴证券</a></td><td>2</td><td>1.040</td><td>48.25</td><td>1.320</td><td>37.73</td><td><a href="/report/industry.jshtml?hyid=438">食品饮料</a></td><td>2022-02-18</td></tr><tr><td>33</td><td><a href="//quote.eastmoney.com/unify/r/0.000792">000792</a></td><td><a href="/stockdata/000792.html">盐湖股份</a></td><td><a href="/report/000792.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,000792.html">股吧</a></td><td><a href="/report/info/AP202202181547695004.html">钾锂龙头王者归来,去芜存菁成长可期</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000064">华安证券</a></td><td>3</td><td>0.740</td><td>44.78</td><td>1.810</td><td>18.18</td><td><a href="/report/industry.jshtml?hyid=731">化肥行业</a></td><td>2022-02-18</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>34</td><td><a href="//quote.eastmoney.com/unify/r/0.300499">300499</a></td><td><a href="/stockdata/300499.html">高澜股份</a></td><td><a href="/report/300499.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,300499.html">股吧</a></td><td><a href="/report/info/AP202202181547692356.html">高澜股份点评报告:储能+新能源汽车+特高压业务预期乐观</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000206">浙商证券</a></td><td>1</td><td>0.290</td><td>43.52</td><td>0.540</td><td>23.14</td><td><a href="/report/industry.jshtml?hyid=910">专用设备</a></td><td>2022-02-18</td></tr><tr><td>35</td><td><a href="//quote.eastmoney.com/unify/r/1.603899">603899</a></td><td><a href="/stockdata/603899.html">晨光文具</a></td><td><a href="/report/603899.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603899.html">股吧</a></td><td><a href="/report/info/AP202202171547622576.html">砥砺前行的文创巨头,把握布局良机</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000048">华西证券</a></td><td>1</td><td>1.620</td><td>35.87</td><td>1.970</td><td>29.45</td><td><a href="/report/industry.jshtml?hyid=440">家用轻工</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>36</td><td><a href="//quote.eastmoney.com/unify/r/0.002092">002092</a></td><td><a href="/stockdata/002092.html">中泰化学</a></td><td><a href="/report/002092.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002092.html">股吧</a></td><td><a href="/report/info/AP202202171547610632.html">2021年净利大幅增长,拟收购美克化工助推估值提升</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000135">中国银河</a></td><td>1</td><td></td><td></td><td>1.350</td><td>8.01</td><td><a href="/report/industry.jshtml?hyid=1019">化学原料</a></td><td>2022-02-17</td></tr><tr><td>37</td><td><a href="//quote.eastmoney.com/unify/r/1.600702">600702</a></td><td><a href="/stockdata/600702.html">舍得酒业</a></td><td><a href="/report/600702.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,600702.html">股吧</a></td><td><a href="/report/info/AP202202171547609134.html">2021年顺利收官,2022年可期</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000049">华鑫证券</a></td><td>3</td><td>3.710</td><td>54.00</td><td>5.610</td><td>35.70</td><td><a href="/report/industry.jshtml?hyid=477">酿酒行业</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>38</td><td><a href="//quote.eastmoney.com/unify/r/1.601633">601633</a></td><td><a href="/stockdata/601633.html">长城汽车</a></td><td><a href="/report/601633.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,601633.html">股吧</a></td><td><a href="/report/info/AP202202171547606945.html">缺芯对1月产销扰动仍存,爆款车型销量靓丽</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000135">中国银河</a></td><td>15</td><td>0.740</td><td>52.95</td><td>1.170</td><td>33.35</td><td><a href="/report/industry.jshtml?hyid=1029">汽车整车</a></td><td>2022-02-17</td></tr><tr><td>39</td><td><a href="//quote.eastmoney.com/unify/r/0.002850">002850</a></td><td><a href="/stockdata/002850.html">科达利</a></td><td><a href="/report/002850.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002850.html">股吧</a></td><td><a href="/report/info/AP202202171547607129.html">动态点评:业绩靓丽,彰显龙头地位</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000049">华鑫证券</a></td><td>1</td><td>2.340</td><td>61.90</td><td>4.850</td><td>29.90</td><td><a href="/report/industry.jshtml?hyid=1033">电池</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>40</td><td><a href="//quote.eastmoney.com/unify/r/1.603115">603115</a></td><td><a href="/stockdata/603115.html">海星股份</a></td><td><a href="/report/603115.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603115.html">股吧</a></td><td><a href="/report/info/AP202202171547603820.html">电极箔行业龙头企业,长期增长趋势明确</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000048">华西证券</a></td><td>3</td><td>0.920</td><td>24.62</td><td>1.400</td><td>16.20</td><td><a href="/report/industry.jshtml?hyid=478">有色金属</a></td><td>2022-02-17</td></tr><tr><td>41</td><td><a href="//quote.eastmoney.com/unify/r/1.603896">603896</a></td><td><a href="/stockdata/603896.html">寿仙谷</a></td><td><a href="/report/603896.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603896.html">股吧</a></td><td><a href="/report/info/AP202202171547592765.html">百年品牌创新发展,销售外拓再创辉煌</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=10001055">国海证券</a></td><td>2</td><td>1.350</td><td>41.30</td><td>1.710</td><td>32.40</td><td><a href="/report/industry.jshtml?hyid=1040">中药</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>42</td><td><a href="//quote.eastmoney.com/unify/r/1.603324">603324</a></td><td><a href="/stockdata/603324.html">盛剑环境</a></td><td><a href="/report/603324.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603324.html">股吧</a></td><td><a href="/report/info/AP202202171547592764.html">点评:调整环保项目投资额,加大新技术研发投入</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=10001055">国海证券</a></td><td>1</td><td>1.430</td><td>29.92</td><td>2.210</td><td>19.33</td><td><a href="/report/industry.jshtml?hyid=728">环保行业</a></td><td>2022-02-17</td></tr><tr><td>43</td><td><a href="//quote.eastmoney.com/unify/r/0.002410">002410</a></td><td><a href="/stockdata/002410.html">广联达</a></td><td><a href="/report/002410.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002410.html">股吧</a></td><td><a href="/report/info/AP202202171547589648.html">Reset expectation</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80027629">招银国际</a></td><td>9</td><td>0.580</td><td>97.60</td><td>0.730</td><td>76.90</td><td><a href="/report/industry.jshtml?hyid=737">软件开发</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>44</td><td><a href="//quote.eastmoney.com/unify/r/1.603259">603259</a></td><td><a href="/stockdata/603259.html">药明康德</a></td><td><a href="/report/603259.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603259.html">股吧</a></td><td><a href="/report/info/AP202202171547587118.html">药明康德:业绩强势增长,2022年化学业务再加速</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000122">首创证券</a></td><td>8</td><td>2.090</td><td>46.80</td><td>3.090</td><td>31.60</td><td><a href="/report/industry.jshtml?hyid=727">医疗服务</a></td><td>2022-02-17</td></tr><tr><td>45</td><td><a href="//quote.eastmoney.com/unify/r/1.605499">605499</a></td><td><a href="/stockdata/605499.html">东鹏饮料</a></td><td><a href="/report/605499.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,605499.html">股吧</a></td><td><a href="/report/info/AP202202171547587116.html">公司业绩快报点评:产品矩阵持续优化 渠道建设积极发力</a></td><td>增持</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80490040">申港证券</a></td><td>4</td><td>2.980</td><td>60.36</td><td>4.140</td><td>43.53</td><td><a href="/report/industry.jshtml?hyid=438">食品饮料</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>46</td><td><a href="//quote.eastmoney.com/unify/r/1.603856">603856</a></td><td><a href="/stockdata/603856.html">东宏股份</a></td><td><a href="/report/603856.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603856.html">股吧</a></td><td><a href="/report/info/AP202202171547573151.html">首次覆盖报告:市政工程管道龙头,22年或将迎来业绩高增</a></td><td>买入</td><td>首次</td><td><a href="/report/orgpublish.jshtml?orgcode=80000074">光大证券</a></td><td>2</td><td>0.490</td><td>35.00</td><td>1.520</td><td>11.00</td><td><a href="/report/industry.jshtml?hyid=476">装修建材</a></td><td>2022-02-17</td></tr><tr><td>47</td><td><a href="//quote.eastmoney.com/unify/r/1.600383">600383</a></td><td><a href="/stockdata/600383.html">金地集团</a></td><td><a href="/report/600383.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,600383.html">股吧</a></td><td><a href="/report/info/AP202202171547573149.html">毛利率下滑略超预期,中长期业绩仍具弹性</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000091">东方证券</a></td><td>5</td><td>2.100</td><td>6.10</td><td>2.700</td><td>4.70</td><td><a href="/report/industry.jshtml?hyid=451">房地产开发</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>48</td><td><a href="//quote.eastmoney.com/unify/r/1.603338">603338</a></td><td><a href="/stockdata/603338.html">浙江鼎力</a></td><td><a href="/report/603338.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,603338.html">股吧</a></td><td><a href="/report/info/AP202202171547568726.html">反倾销终裁落地,成本可控终迎坦途</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000157">中泰证券</a></td><td>2</td><td>1.850</td><td>31.73</td><td>2.780</td><td>21.15</td><td><a href="/report/industry.jshtml?hyid=739">工程机械</a></td><td>2022-02-17</td></tr><tr><td>49</td><td><a href="//quote.eastmoney.com/unify/r/0.002475">002475</a></td><td><a href="/stockdata/002475.html">立讯精密</a></td><td><a href="/report/002475.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,002475.html">股吧</a></td><td><a href="/report/info/AP202202171547568668.html">AR/VR加速消费电子成长,汽车时代新平台成立</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80000124">天风证券</a></td><td>2</td><td>1.190</td><td>34.36</td><td>1.650</td><td>24.94</td><td><a href="/report/industry.jshtml?hyid=1037">消费电子</a></td><td>2022-02-17</td></tr><tr style="background-color: rgb(246, 244, 236);"><td>50</td><td><a href="//quote.eastmoney.com/unify/r/0.000333">000333</a></td><td><a href="/stockdata/000333.html">美的集团</a></td><td><a href="/report/000333.html" class="red">详细</a> 
<a href="//guba.eastmoney.com/list,000333.html">股吧</a></td><td><a href="/report/info/AP202202171547561498.html">投建新能源车部件基地,制造价值面临重估</a></td><td>买入</td><td>维持</td><td><a href="/report/orgpublish.jshtml?orgcode=80092742">信达证券</a></td><td>1</td><td>4.170</td><td>17.58</td><td>4.660</td><td>15.74</td><td><a href="/report/industry.jshtml?hyid=456">家电行业</a></td><td>2022-02-17</td></tr></tbody></table></div>




兄好,这是采集页面对应的采集项,我找的是tbody对应的table:id,id应该没错呀
PeppaPig 发表于 2022-2-21 01:08
jackyjiam 发表于 2022-2-20 11:14
[md]序号股票代码股票简称相关报告名称东财评级评级变动机构近一月个股研报数2021盈利预测2022盈利预测行 ...

昨天我找了很多资料,你可以直接搜东方财富爬虫有个案例,没去试,你可以试试,我的话,昨天是看到说tbody下面用xpath会返回为空,然后看到有个帖子讲到这个数据是get请求到的,下面是我昨天抓的链接:http://78.push2.eastmoney.com/api/qt/clist/get?cb=jQuery112406038713662208435_1645299710429&pn=1&pz=20&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&fid=f3&fs=m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23,m:0+t:81+s:2048&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152&_=1645299710430
PeppaPig 发表于 2022-2-21 05:02
jackyjiam 发表于 2022-2-20 11:14
[md]序号股票代码股票简称相关报告名称东财评级评级变动机构近一月个股研报数2021盈利预测2022盈利预测行 ...

[Python] 纯文本查看 复制代码
import json
from openpyxl import Workbook
import requests
import re
import pandas as pd
import time
import random

def main():                              #                                                                     v
    url = "http://78.push2.eastmoney.com/api/qt/clist/get?cb=jQuery112406038713662208435_1645299710429&pn=1&pz=2000&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&fid=f3&fs=m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23,m:0+t:81+s:2048&" \
          "fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152&_=1645299710430"
    wb = Workbook()
    sheet = wb.active
    sheet.append([" ","最新价","涨跌幅","涨跌额","成交量(手)","成交额","振幅","换手率","市盈率(动态)","量比","5分钟涨跌","代码"," ","名称","最高","最低","今开","昨收","总市值","流通市值","涨速","市净率","60日涨幅跌","年初至今涨幅跌"])

    r = requests.get(url)
    data = r.text
    chuli1=data.replace("jQuery112406038713662208435_1645299710429(","")
    chuli2=chuli1.replace(");","")
    datas=json.loads(chuli2)['data']['diff']
    count=0
    b=0.008
    for i in datas:
        src=[]
        for j in i:
            src.append(i[j])
        count+=1
        sheet.append(src)
        timer=random.randint(0,19)
        print('**正在下载{}条数据**'.format(count))
        time.sleep(timer*b)
    wb.save('东方财富网信息采集.xlsx')

if __name__ == "__main__":
    main()

代码给你做好了,但是这个url不知道会不会出问题
 楼主| jackyjiam 发表于 2022-2-21 09:15
PeppaPig 发表于 2022-2-21 05:02
[mw_shl_code=python,true]import json
from openpyxl import Workbook
import requests

兄好,首先非常感谢您帮忙测试,我测试了你的代码确实能下到数据,我用你提到的方法(get)获取了"https://data.eastmoney.com/report/stock.jshtml"  找了对应链接的数据没找到,可能我用的方法不对吧
PeppaPig 发表于 2022-2-21 20:17
jackyjiam 发表于 2022-2-21 09:15
兄好,首先非常感谢您帮忙测试,我测试了你的代码确实能下到数据,我用你提到的方法(get)获取了"https:// ...

https://reportapi.eastmoney.com/report/list?cb=datatable13814&industryCode=546&pageSize=50&industry=*&rating=*&ratingChange=*&beginTime=2020-02-21&endTime=2022-02-21&pageNo=1&fields=&qType=0&orgCode=&code=*&rcode=&_=1645445044776
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-1-13 03:28

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表