I am a beginner using Python and Pycurl for webpage stressing testing purposes. However, pycurl keeps printing out returned html in the terminal which makes the stress testing take even more time than it should. One such pycurl code I am using is posted below. Is there a way to just run pycurl without having to print or write the result anywhere? Any assistance would be appreiciated.
p = pycurl.Curl()
p.setopt(pycurl.POST, 0)
p.setopt(pycurl.COOKIE, sessioncookie)
p.setopt(pycurl.URL, 'http://example.com/logoff.php')
p.perform()
p.close()
The Pycurl documentation is terrible, but I think you want to set WRITEFUNCTION to a function that does nothing, e.g.
p.setopt(pycurl.WRITEFUNCTION, lambda x: None)
Also, I wish to state for the record that I thought "SET does everything" APIs went out with VMS. Gaaah.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With