Aug-25-2021, 11:26 AM
Thank you.
I was running small print statements as I was going to verify and everything looked good up until adding the last requests line.
So the last print statement where everything was working was:
I think I may give up on this one! Maybe I might use a few full header variations in a list in the code rather than get the code to pick part of it from a spreadsheet.
Really appreciate your help and time though.
I was running small print statements as I was going to verify and everything looked good up until adding the last requests line.
So the last print statement where everything was working was:
or cell in ws['A']: random_header_variable = cell.value headers = "{'User-Agent': " + random_header_variable + "}" print(headers)That printed all the headers and it looked correct. As soon as I added:
r = requests.get(url, headers = headers)(I didn't try a print statement at that point), I got the errors as posted above.
I think I may give up on this one! Maybe I might use a few full header variations in a list in the code rather than get the code to pick part of it from a spreadsheet.
Really appreciate your help and time though.
(Aug-24-2021, 02:18 AM)bowlofred Wrote: You can add a print statement in your loop to verify it's making progress.
... r = requests.get(url, headers = headers) print(f"Got {r.status} code from {r.url} lookup")In your original code, you don't seem to be doing anything with the result of the get. How are you using it?