English
联系我们
网站地图
邮箱
旧版回顾



传教士

China to issue 6b yuan sovereign bonds in Macao for fifth year_我的网站

千方百计爱上你

A |     

     阿里云优惠券 先领券再下单        前面有写过一篇瀑布流的采集方法,今天在添加一个POST方法来采集Ajax刷新页面的教程。    之前的文章请看:火车头采集动态加载Ajax数据(无分页瀑布流网站)    如果遇到POST方法来架子Ajax数据,这和我之前写的是两个类型,瀑布流是直接刷新出数据的页面。

B |     

A concept photo of currencies and financial market Illustration: VCG
    A concept photo of currencies and financial market Illustration: VCG
The Macao Special Administrative Region (SAR) government said on Monday that the central government will issue 6 billion yuan ($889.20 million) of sovereign bonds in Macao on August 20.
This year marks the fifth consecutive year that the central government is issuing yuan-denominated sovereign bonds in Macao, a move that shows the central government's strong support for Macao's appropriate economic diversification and further strengthens the competitiveness of Macao's featured financial industry, according to a joint statement issued by China's Ministry of Finance and the Macao SAR government.
The announcement noted that the issuance features a more diversified structure, which is expected to improve the regular issuance mechanism while providing investors with safer and more stable yuan-denominated investment options.
The Macao SAR government said that the move fully demonstrates the importance the central government attaches to, and its support for Macao in accelerating the cultivation of the bond market, promoting the quality development of the featured financial sector, and fostering the appropriate diversification of the economy. 
The continued issuance of sovereign bonds is believed to attract a broader spectrum of high-quality issuers and international investors to participate in Macao's bond market, better leverage Macao's advantages and strategic role in the nation's opening-up, and support Macao in better integrating into and serving the overall national development, said the statement released by the Macao SAR government.
With this issuance, the cumulative yuan-denominated sovereign bond issuance in Macao will reach 27 billion yuan since the Ministry of Finance first entered the market in 2019. 
Global Times
。    采集网站分析    采集任何一个新站前我们都要对他进行一番分析才好下手。    列表页分析    这个网站的列表页,前面并不是通过Ajax加载的。CTRL+U可以直接看到列表内容,通过浏览器也看不到相关请求地址。    
    因为习惯原因,我直接看了下尾页列表页。然后顺手CTRL+U看看网站代码结构有没有大的变化。防止后期采集出错。

C | 结果就发现无法看到列表内容。浏览器可以看到一个通过post请求的地址。    

    这时候就意识到这网站列表页可能后面的应该全是通过Ajax加载的。    通过笨方法,手动访问页面看看Ajax加载大概是哪些。最后找到大概从2200页左右开始Ajax加载。    那我们采集的时候,前面的列表页就可以使用普通方式去采集(速度更快)。

D |     2200页开始到尾页就通过post请求Ajax页面数据。    抓包获取Post数据    这个Ajax地址我在浏览器看不到任何跟页码有关的数据。

E | 最后只能使用抓包工具看一下详细的请求内容了。    

    使用抓包工具Fiddler    Fiddler下载地址:OneDrive-Fiddler-Setup_v5.0.20204.45441.zip    安装设置完成后我们打开浏览器。重新访问一下采集页面,Fiddler会抓到很多请求地址。    查看分析Post数据    Ctrl+F 我们搜索那个Ajax地址    
火车头使用Post方法采集Ajax页面教程
    Fiddler会以黄色将搜索到的结果显示出来,我们点击一下他。

F |     

火车头使用Post方法采集Ajax页面教程
    在Fiddler右侧会显示这个请求地址的相关详细信息。    
    信息顶部可以看到是post请求方法。    可以看到有我们请求的页码相关内容。

G |     

    访问不同页码的页面,经过研究发现规律。    
    currentPageIndex的值和页码相关,值等于页码减一。

H | 我们访问6139页时,currentPageIndex值是6138。    这就找到了规律,我们打开火车头采集器。    火车头采集器配置分页设置    起始网址填入Ajax请求地址    

    点“高级模式”。    
    点“分页设置”,http请求方式“post”。    
    把我们Fiddler抓包获取的内容填进去。    
    将currentPageIndex值的内容替换成火车头采集器的“分页”标签。    
    下面填入页码。    页面地址是从2200到6140,上面我们分析得出post请求内容的currentPageIndex值是实际页码减一。

I | 所以这里面我们填2199到6139.    

    网址获取选项设置    为了筛选出我们需要的内容,我们设置一下网址获取选项。    打开浏览器F12开发工具,预览一下Ajax获取的内容。    
    可以看到链接的形式是    自考成考报名条件有哪些?    完整的链接地址是    https://域名/chengrenzikao/20200611152022.html    那我们就可以使用下面的规则提取地址。    
    我们测试一下网址采集。

J |     测试网址采集    点击测试可能提示“post请求必须选择网页编码”我们在火车头其他设置中将编码选为“UTF8”即可。    

    可以看到已经正确获取到了链接。不放心可以复制链接实际访问一下看看是否正确。    
    注意事项    采集过程注意运行线程和请求间隔时间。教程在测试时因为开的线程较多,频率过高导致对方网站开启了防CC设置。拉黑了我一个服务器IP,此教程写完用了两台服务器。    我们实际采集可以只开1个线程,并设置合适的间隔时间,比如1000ms到1500ms左右。    本文来自2号站长网,转载请注明出处:https://www.zz2zz.com/331414.html
        
    

申请创业报道,分享创业好点子。点击此处,共同探讨创业新机遇!。

Current article:http://www.jiaopeikongbenlo.pics/b8x4/cxk2.htm

Published on:02:09:35


专题推荐

相关新闻


© 1996 - 我的网站 版权所有   联系我们

地址:北京市三里河路52号 邮编:100864