Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Instagram actions with selenium

Hello! I am considering making an instagram bot that would run in browser through selenium. To be fair, I dobt really know anything about API usage, so I would run it all through pyautogui and selenium (using clicks and fills based on ID's). How efficient and effective would this be? Also, at what pount would I need to get a proxy/vpn?
API's tend to be fairly limited and can cost you money, the plus side is they're incredibly fast because they run on the website's servers themselves, it also depends on what kind of information you're looking to get from Instagram.

If you use selenium the start of the program would be slow (Selenium uses webdrivers like chrome, firefox or phantomjs) so you'd have to wait for the browser to load - that'd be your main issue. However once it's up and going it wouldn't be too bad.

Webdrivers are amazing and selenium can take full functionality from them so you wouldn't need pyautogui at all, you can send keystrokes, take screenshots of the entire page (or certain elements) and click buttons - even if the browser is minimized. This is because the webdriver can simulate those things without needing the real thing.

As for vpn / proxy issue, yes and no. If you're just using it for a legit reason you probs don't need a vpn (I'm not one of those assholes that thinks privacy is only needed when you're doing illegal things lol. I'm just saying in general). Concerning a proxy - these are a lot more popular in webscraping / bots in case the website decides you're sending too many requests. Basically you just have it use 1 proxy in a list and as soon as you detect you've been blocked you switch to the second proxy etc... I'd recommend an anonymous proxy to avoid detection (proxy requests have a header in them that basically can tell the website you're on a proxy, anonymous proxy's do not).

If Instagram doesn't start putting temporary blocks on you, no need to worry about a proxy 🤝
[Image: 5BgQiIm.gif]

(Apr 23, 2017 09:02 AM)TheWarOwl Wrote:  API's tend to be fairly limited and can cost you money, the plus side is they're incredibly fast because they run on the website's servers themselves, it also depends on what kind of information you're looking to get from Instagram.

If you use selenium the start of the program would be slow (Selenium uses webdrivers like chrome, firefox or phantomjs) so you'd have to wait for the browser to load - that'd be your main issue. However once it's up and going it wouldn't be too bad.

Webdrivers are amazing and selenium can take full functionality from them so you wouldn't need pyautogui at all, you can send keystrokes, take screenshots of the entire page (or certain elements) and click buttons - even if the browser is minimized. This is because the webdriver can simulate those things without needing the real thing.

As for vpn / proxy issue, yes and no. If you're just using it for a legit reason you probs don't need a vpn (I'm not one of those assholes that thinks privacy is only needed when you're doing illegal things lol. I'm just saying in general). Concerning a proxy - these are a lot more popular in webscraping / bots in case the website decides you're sending too many requests. Basically you just have it use 1 proxy in a list and as soon as you detect you've been blocked you switch to the second proxy etc... I'd recommend an anonymous proxy to avoid detection (proxy requests have a header in them that basically can tell the website you're on a proxy, anonymous proxy's do not).

If Instagram doesn't start putting temporary blocks on you, no need to worry about a proxy 🤝

Sorry for a bit of an off-topic here, but do you know the cheapest way of getting anonymous proxies in bulks? thxxx
(Apr 27, 2017 11:47 AM)gaidenukstiskrv Wrote:  Sorry for a bit of an off-topic here, but do you know the cheapest way of getting anonymous proxies in bulks? thxxx

You find some legit proxy list sites, turn on their filters and scrape 'em. Should be more than easy enough to figure out.

Seriously, why do you even ask this question?
Just use selenium:

PHP Code

<?php 
driver 
= webdriver.Firefox()
driver.get(link here)
example = 'hi'
elements = driver.find_element_by_xpath('//[@name=("name")]')
elements.send_keys(example)
elements.send_keys(Keys.RETURN) 
(example is not accurate don't copy and paste and expect it to work lol)
seems pretty efficient to me :p
and it also depends on your situation if a proxy is needed
leave me a message if you need any help
Well I'd first try the requests library, but it all depends of what you are trying to do, so once you figure that out then you can pick the best rout.

Good luck though!


——————————————————————
If you want to learn Python (or just about any language), Join Me!
How do you like my redneck signature?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Luffy-_-Aug 20, 2023 02:06 AM 12 446 Aug 20, 2023 02:06 AM
Last Post: Lucky4L
[Python] by Don CezarAug 20, 2023 01:37 AM 5 500 Aug 20, 2023 01:37 AM
Last Post: Lucky4L
by darkfantaOct 22, 2022 11:14 AM 6 366 Oct 22, 2022 11:14 AM
Last Post: darkfanta