Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • User-Agent for URL requests in copy or import delimited

    Does Stata support passing in a user agent into a url request? For example, when trying to import delimited "url_example" where the url is a flat txt file.

    this isnt a problem on many websites, but currently bls.gov flat files (such as https://download.bls.gov/pub/time.se...ata.1.AllItems) pop up as a 403 error. When trying to download on python, the same error occurs until you pass in the user-agent of an email (as stipulated by the bls site).

    If not, how would you download the flat file with code without downloading the txt onto your computer.

  • #2
    I don’t do this myself but from your description I would use Python from within or outside of Stata to download a copy of the file.

    Comment


    • #3
      Ya i can do it with python, but is there a way for stata to do it? I just have a really long pipeline that does this a lot and want to avoid calling python every time. BLS did not use to do this. thanks though, it seems that might be the only way.

      Comment

      Working...
      X