Downloading pdf files from a php server using python

I am trying to download the PDFs (a few can be word files, very rarely) located on a PHP server. It appears that on the server, the PDFs are numbered increasingly from 1 to 14000. The PDFs can be downloaded using the link: http://ppmoe.dot.ca.gov/des/oe/awards/bidsum/dl.php?id=X, where X is a number in the [1, 14000] range. I… Read More Downloading pdf files from a php server using python

Download data.zip programmatically for "Loophole-free Bell-inequality violation using electron spins separated by 1.3 kilometres" experiment

I would like to create a gist or a Jupyter notebook analyzing the data located at Loophole-free Bell-inequality violation using electron spins separated by 1.3 kilometres. The site has this download button which right-clicking to copy-paste the link tells me it associated with the URL https://data.4tu.nl/ndownloader/files/24056582. If I copy-paste this URL into Firefox it downloads… Read More Download data.zip programmatically for "Loophole-free Bell-inequality violation using electron spins separated by 1.3 kilometres" experiment

SQL Join Using REGEXP_SUBSTR and Wildcard

I’m trying to join two tables in Snowflake using REGEX_SUBSTR and a wildcard but having no luck. Here is what I have: SELECT P.NAME, ACL.CONTENT_NAME, REGEXP_SUBSTR(CONTENT_NAME, ‘/([^/]+(\\.pdf))$’, 1, 1, ‘e’, 1) AS PDFS FROM ACTIVITY_DOWNLOAD AD JOIN PROGRAM P ON P.NAME LIKE ‘%’ || REGEXP_SUBSTR(CONTENT_NAME, ‘/([^/]+(\\.pdf))$’, 1, 1, ‘e’, 1) || ‘%’ Running the query… Read More SQL Join Using REGEXP_SUBSTR and Wildcard

Export Postgresql Table to excel with header in Python

My code works but it doesn’t bring the header with the names, it only brings the numbers 0 1 … 10 , what can I do ? Utils_db.py def consulta_sql(sql): try: connection = psycopg2.connect(user="postgres", password="postgres", host="localhost", port="5432", database="tb_cliente") cursor = connection.cursor() except (Exception, psycopg2.Error) as error: try: cursor.execute(sql) connection.commit() except (Exception, psycopg2.Error) as error: finally:… Read More Export Postgresql Table to excel with header in Python

How to handle "The given header was not found" when paging records in c# API GET request?

I’m requesting data from an API that requires paging records based on a custom header called "cursor". Only 100 records may be retrieved per call and as such I’ve created a while loop to execute. The loop functions… until it doesn’t. Once all records are paged, the headers get dropped and my program errors out… Read More How to handle "The given header was not found" when paging records in c# API GET request?