Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Why do you introduce the variable session? It's never used. And you should not call __exit__ directly, that's only used by the with-statement. Your second post request is not done in the same session as the login request. You probably ment `r=c.post(thisurl, data=thisvalues)`. Btw. `c` is no good name for a variable, because the name should mean something, the same with `thisvalues` and `thisurl`; the `this` doesn't add any information to the name.
import requests
with requests.session() as c:
url='https://xenforo.com/community/login/login'
USERNAME='minneconsin@gmail.com'
PASSWORD='Demo12345'
c.get(url)
login_data=dict(login=USERNAME,password=PASSWORD,next="/")
c.post(url,data=login_data,headers={"Referer":"https://xenforo.com/community/"})
values='This is auto reply'
url2='https://xenforo.com/community/threads/nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp.3864/'
r=c.post(url2,data=values)
page=c.get('https://xenforo.com/community/threads/nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp-nbsp.3864/page-2')
print(page.content)
No error but can't add comment "this is auto test" to that topic. Please help me fix it.
@wichit12: You'll have to do what a browser would do to add a reply. The Firebug addon for Firefox can be useful to analyse the communication between the browser and the server while adding a post manually.