This works if I'm logged in to the browser, no problem. But what I'm struggling with is how to send that request as part of a script. So for example, I put together what I thought would be a simple Python script:
import requests
from requests.auth import HTTPBasicAuth
auth=HTTPBasicAuth('USERNAME', 'APIKEY')
r = requests.get('https://www.dreamwidth.org/export_comments?get=comment_body&startid=0&authas=COMMNAME', auth=auth)print(r.text)
What I get back is the Dreamwidth login page. I'm sure there's something extremely obvious that I'm missing here, but dammit Jim, I'm a docs writer, not a developer.
no subject
Novice barely-knows-how-to-code question here.
I'm trying to scrape comments from a community with an HTTPS call, using the URL:
https://www.dreamwidth.org/export_comments?get=comment_body&startid=0&authas=COMMNAME
This works if I'm logged in to the browser, no problem. But what I'm struggling with is how to send that request as part of a script. So for example, I put together what I thought would be a simple Python script:
import requests
from requests.auth import HTTPBasicAuth
auth=HTTPBasicAuth('USERNAME', 'APIKEY')
r = requests.get('https://www.dreamwidth.org/export_comments?get=comment_body&startid=0&authas=COMMNAME', auth=auth)
print(r.text)
What I get back is the Dreamwidth login page. I'm sure there's something extremely obvious that I'm missing here, but dammit Jim, I'm a docs writer, not a developer.