![]() |
|
[Python] Trying to learn request/urllib and other http form modules - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Trying to learn request/urllib and other http form modules (/showthread.php?tid=5665439) |
Trying to learn request/urllib and other http form modules - 41phafr34k - Jul 9, 2017 Here is a bit of code, basically was stolen and improvised from about 3 or 4 chunks of code. Am I using requests properly? Right now I figure I'll learn how to login into a webpage then begin doing other small tasks with that knowledge. Code import requests* - nizarnizario - Jul 9, 2017 If you want to do tasks like click button , fill form... Requests won't do it , you'll have to use selenium, cuz it supports javascript. * - 41phafr34k - Jul 9, 2017 (Jul 9, 2017 08:57 AM)nizarnizario Wrote: If you want to do tasks like click button , fill form... Requests won't do it , you'll have to use selenium, cuz it supports javascript. Thanks this is just the answer I was looking for. Is this the correct package? https://pypi.python.org/pypi/selenium * - Vanagander - Jul 9, 2017 (Jul 9, 2017 09:20 AM)41phafr34k Wrote: Thanks this is just the answer I was looking for. Yep, that's the one. Here is some documentation on how to use Selenium: Docs * - 41phafr34k - Jul 9, 2017 This is what i get when i try to run the script Code spyder@spyder-desktop ~/Desktop $ python sel.py NVM I got it, simply had to re-unpack chromedriver and set the path along with download chromium. Didnt realize it wasn't trying to open FF. * - Riԁdle - Jul 9, 2017 (Jul 9, 2017 08:57 AM)nizarnizario Wrote: If you want to do tasks like click button , fill form... Requests won't do it , you'll have to use selenium, cuz it supports javascript. you can do a post request too login.... with requests and be 10x faster then selenium * - nizarnizario - Jul 9, 2017 Riddle , yup he can do login , but if he needed some kind of action (like bots do: clicking, liking , watching...) he need to do it using selenium :) * - Wireless Network - Jul 9, 2017 (Jul 9, 2017 11:31 AM)nizarnizario Wrote: Riddle , yup he can do login , but if he needed some kind of action (like bots do: clicking, liking , watching...) he need to do it using selenium :) Wrong. He can just capture http request and do the same thing via python requests. * - nizarnizario - Jul 9, 2017 Wireless Network ,,,, let's assume he wants to create a Adf.Ly bot, he has to wait for the JS timer :) and of course Requests doesn't support that, requests module doesn't work with anything JS-related |