Skip to content

用python3运行报错 #1

@16bh

Description

@16bh

Traceback (most recent call last):
File "crawler.py", line 56, in parse_url_to_html
f.write(html)
TypeError: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "crawler.py", line 119, in
main()
File "crawler.py", line 108, in main
htmls = [parse_url_to_html(url, str(index) + ".html") for index, url in enumerate(urls)]
File "crawler.py", line 108, in
htmls = [parse_url_to_html(url, str(index) + ".html") for index, url in enumerate(urls)]
File "crawler.py", line 60, in parse_url_to_html
print(e.message)
AttributeError: 'TypeError' object has no attribute 'message'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions