Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
urllib request urlopen?
#1
Hi,

I have build a small program with Python3. I'm using urllib.request.urlopen() to download csv files from an open API.
I save the files with file.write(url). After the download the content is imported to a db (sqlite).

It works good but I wonder if this is a Pythonic way to do it? Is it possible to save the content in the csv file to a list instead of a file?
The files are maybe around 1 MB.

Should I keep it as it is or do you guys have a better idea?

I just want to learn the right way.
Reply


Messages In This Thread
urllib request urlopen? - by nutgut - Mar-24-2018, 07:30 PM
RE: urllib request urlopen? - by Larz60+ - Mar-24-2018, 08:53 PM
RE: urllib request urlopen? - by nutgut - Mar-26-2018, 11:39 AM
RE: urllib request urlopen? - by snippsat - Mar-26-2018, 05:15 PM
RE: urllib request urlopen? - by nutgut - Apr-14-2018, 01:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting from <td> tag by using urllib,Beautifulsoup KuroBuster 2 2,078 Aug-20-2021, 07:53 AM
Last Post: KuroBuster
  Can urlopen be blocked by websites? peterjv26 2 3,413 Jul-26-2020, 06:45 PM
Last Post: peterjv26
  Beginner: urllib error tomfry 7 6,608 May-03-2020, 04:35 AM
Last Post: Larz60+
  SSLCertVerificationError using urllib (urlopen) FalseFact 1 5,910 Mar-31-2019, 08:34 AM
Last Post: snippsat
  Error: module 'urllib' has no attribute 'urlopen' mitmit293 2 15,074 Jan-29-2019, 02:32 PM
Last Post: snippsat
  [Errno11004] Get addrinfo failed with urlopen prashanth0988 2 13,843 Aug-02-2018, 01:41 PM
Last Post: iiooii
  urllib urlopen getting error 400 on 1 specific page glidecode 4 4,144 Mar-01-2018, 11:01 PM
Last Post: glidecode
  urllib2.urlopen() user agent header Skaperen 8 12,677 Jul-14-2017, 05:36 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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