Sitemap generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
942 B

  1. # pysitemap
  2. Sitemap generator
  3. ## installing
  4. pip install sitemap-generator
  5. ## Gevent
  6. Sitemap-generator uses [gevent](http://www.gevent.org/) to implement multiprocessing. Install gevent:
  7. pip install gevent
  8. ## example
  9. import pysitemap
  10. if __name__ == '__main__':
  11. url = 'http://www.example.com/' # url from to crawl
  12. logfile = 'errlog.log' # path to logfile
  13. oformat = 'xml' # output format
  14. crawl = pysitemap.Crawler(url=url, logfile=logfile, oformat=oformat)
  15. crawl.crawl()
  16. ## multiprocessing example
  17. import pysitemap
  18. if __name__ == '__main__':
  19. url = 'http://www.example.com/' # url from to crawl
  20. logfile = 'errlog.log' # path to logfile
  21. oformat = 'xml' # output format
  22. crawl = pysitemap.Crawler(url=url, logfile=logfile, oformat=oformat)
  23. crawl.crawl(pool_size=10) # 10 parsing processes