In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to submit Baidu links with Python". In daily operation, I believe many people have doubts about how to submit Baidu links with Python. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to submit Baidu links with Python". Next, please follow the editor to study!
Import requests
Import requests
Build request header
Headers = {'User-Agent':' curl/7.12.1', 'Host':' data.zz.baidu.com', 'Content-Type':' text / plain', 'Content-Length':' 83'} post_baidu_uri= "*" / / check in the webmaster's tool
Webmaster tool to view push interface
Build the data to be pushed
# first build a linked list post_url = ['http://www.kevinguo.cn/blog/detail/1/','http://www.kevinguo.cn/blog/detail/2/','http://www.kevinguo.cn/blog/detail/3/']# splices the list post_data ='\ n'.join (post_url)
Start initiating a post request
Res = requests.post (url=post_baidu_uri,headers=headers,data=post_data)
If res.status_code==200, post is successful.
The following values may be returned
| | Field | required | Parameter type | description |
| | success | Yes | int | number of url messages successfully pushed |
| | remain | Yes | int | number of url messages that can be pushed remaining in the day | |
| | not_same_site | No | array | list of url that has not been processed because it is not the url of this site | |
| | not_valid | No | array | invalid url list |
If the status code is 4XX, the push is not successful and the following values are returned
| | error | Yes | int | error code, which is the same as status code |
| | message | Yes | string | error description |
Tags: none
At this point, the study on "how to use Python to submit Baidu links" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.