c4software / python-sitemap

Mini website crawler to make sitemap from a website.
GNU General Public License v3.0
366 stars 110 forks source link

Crawler.py giving error #19

Closed KKS161994 closed 7 years ago

KKS161994 commented 7 years ago

On running command mentioned in simple usage of readme.md ........ File "main.py", line 6, in import crawler File "/Users/kartikey/Desktop/SoftwareIncubator/sitemapgen/python-sitemap/crawler.py", line 85 print(config.xml_header, file=self.output_file)

c4software commented 7 years ago

Hi,

Are you sure you are using Python3 ?

sebclick commented 7 years ago

Hello,

I have this same error if I launch python-sitemap with python 2.x.

sebclick ~/Python/python-sitemap $ python main.py 
Traceback (most recent call last):
  File "main.py", line 6, in <module>
    import crawler
  File "/home/sebclick/Python/python-sitemap/crawler.py", line 85
    print(config.xml_header, file=self.output_file)
                                 ^
SyntaxError: invalid syntax
sebclick ~/Python/python-sitemap $ 
sebclick ~/Python/python-sitemap $ 
sebclick ~/Python/python-sitemap $ python --version
Python 2.7.12
sebclick ~/Python/python-sitemap $ 

It's ok with python 3.x :

sebclick ~/Python/python-sitemap $ python3 main.py --help
usage: main.py [-h] [--skipext SKIPEXT] [--parserobots] [--debug] [-v]
               [--output OUTPUT] [--exclude EXCLUDE] [--drop DROP] [--report]
               [--config CONFIG | --domain DOMAIN]

Crawler pour la creation de site map
c4software commented 7 years ago

Hi.

Thanks sebclick. KKS161994 can you check if you are using python3?