實踐步驟,先用爬蟲程序將本網站的所有連接爬取出來,再用python文件處理程序把爬蟲來的東東整理成一行一個鏈接的文本格式。再用postman接口測試工具,使用post方式,將所有的鏈接post過去,這樣主動推送是最為快速的提交方式,推薦將站點(當天新產出鏈接)立即通過此方式推送給百度,以保證新鏈接可以及時被百度收錄。
爬蟲也可以用SitemapX工具,爬下來網站地圖。保存為txt文檔格式,再寫一個小小的python程序處理下
#coding:utf-8
import os
sitemap=open('C:\Users\Administrator\Desktop\sitemap.txt','r')
urlfile=open('C:\Users\Administrator\Desktop\urlfile.txt','a')
content=sitemap.read()
print content
start=0
end=0
while(content.find('<loc>',end)!=-1):
start=content.find('<loc>',end)
end=content.find('</loc>',start)
url=content[start+5:end]
urlfile.write(url)
urlfile.write('\n')
之后打開chrome加載postman,chrome://apps打開postman
輸入接口地址
post ?raw
拷貝過去所有的url
點擊send
成功。
注:有時候postman無法自動獲取到Host地址,這時手動添加head 加入HOST ?value為地址即可。