Python Forum
urlib - to use or not to use ( for web scraping )?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
urlib - to use or not to use ( for web scraping )?
#45
one error corrected by putting open under for loop
for download in downloadList:
    fileUrl = getAbsoluteURL(baseUrl,download["src"])
    if fileUrl is not None:
        print(fileUrl)
    with open(fileUrl, 'wb', getDownloadPath(baseUrl, fileUrl, downloadDirectory)) as out_file:
        out_file.write(fileUrl.content)
but now an another one appears
Error:
http://pythonscraping.com/misc/jquery.js?v=1.4.4 Traceback (most recent call last): File "C:\Python36\kodovi\crawler3.py", line 76, in <module> with open(fileUrl, 'wb', getDownloadPath(baseUrl, fileUrl, downloadDirectory )) as out_file: TypeError: an integer is required (got type str)
Reply


Messages In This Thread
RE: urlib - to use or not to use ( for web scraping )? - by Truman - Dec-17-2018, 11:24 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020