0

I have multiple reports that I need to run and export from service now. I have been using a URL with filtering to get the reports downloaded directly into the downloads folder this way,but would like to create a python 3.10.5 script that would do all this for me and save it all to a specified location. I would then add to this code to do some data merging and add extra columns to the CSV. Is this even possible given ServiceNow requires credentials?

from urllib.request import urlopen

# Download from URL.
with urlopen( 'MyURL' ) as download:
    content = webpage.read()

# Save to file.
with open( 'output.html', 'wb' ) as download:
    download.write( content )

getting a heap of errors most notably HTTP Error 401: unauthorized

B_GOOY
  • 1
  • Try using a different user agent? ServiceNow is probably blocking you to prevent scripts, so only do this if you will be requesting a reasonable amount of pages. https://stackoverflow.com/q/24226781/245915 – nofinator Nov 21 '22 at 16:08

0 Answers0