zoukankan      html  css  js  c++  java
  • SEO 百度后台主动推送链接

    实践步骤,先用爬虫程序将本网站的所有连接爬取出来,再用python文件处理程序把爬虫来的东东整理成一行一个链接的文本格式。再用postman接口测试工具,使用post方式,将所有的链接post过去,这样主动推送是最为快速的提交方式,推荐将站点(当天新产出链接)立即通过此方式推送给百度,以保证新链接可以及时被百度收录。

    爬虫也可以用SitemapX工具,爬下来网站地图。保存为txt文档格式,再写一个小小的python程序处理下

    #coding:utf-8
    import os
    sitemap=open('C:UsersAdministratorDesktopsitemap.txt','r')
    urlfile=open('C:UsersAdministratorDesktopurlfile.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(' ')

    之后打开chrome加载postman,chrome://apps打开postman

    输入接口地址

    post  raw

    拷贝过去所有的url

    点击send

    成功。

    注:有时候postman无法自动获取到Host地址,这时手动添加head 加入HOST  value为地址即可。

  • 相关阅读:
    springcloud配置中心
    burnside+polya 整理
    线段树-小总结
    D. Artsem and Saunders
    444 D. Ratings and Reality Shows
    P1337 [JSOI2004]平衡点 / 吊打XXX
    Typora + Open Live Writer 管理博客园
    旋转卡壳
    B. Alyona and a tree
    set的用法
  • 原文地址:https://www.cnblogs.com/AmilyWilly/p/5955281.html
Copyright © 2011-2022 走看看