redianmarku / Instagram-Multi-Feature-Bot

A python instagram selenium bot that can scrape most recents posts, usernames, send DMs or comment on these posts.
54 stars 22 forks source link

bot won't post message in the dm before it closes. #2

Open Thomas-byt opened 1 year ago

Thomas-byt commented 1 year ago

bot won't post message in the dm before it closes. Kindly check please

redianmarku commented 1 year ago

Just checked now and updated the xpaths of elements of Instagram website. You can try to re-run commenting and DM-ing is working fine now.

Sonusony201 commented 1 year ago

not working till now

Sonusony201 commented 1 year ago

"[WinError 6] The handle is invalid" showing this problem

redianmarku commented 1 year ago

when does this happen? during bot is running? Can you show a more full error message

Sonusony201 commented 1 year ago

it work and open hashtag but after hashtag its close the window and show me error (Traceback (most recent call last): File "E:\auto coment\Instagram-Multi-Feature-Bot-master\Instagram-Multi-Feature-Bot-master\run.py", line 91, in main() File "E:\auto coment\Instagram-Multi-Feature-Bot-master\Instagram-Multi-Feature-Bot-master\run.py", line 77, in main post_links = bot.scrape_hashtag_posts(hashtag=args.hashtag) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\auto coment\Instagram-Multi-Feature-Bot-master\Instagram-Multi-Feature-Bot-master\InstagramBot.py", line 49, in scrape_hashtag_posts most_recent = self.driver.find_element(By.XPATH, '//div/div/div[2]/div/div/div/div[1]/div[1]/div[2]/section/main/article/div[2]/div') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 740, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 346, in execute self.error_handler.check_response(response) File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div/div/div[2]/div/div/div/div[1]/div[1]/div[2]/section/main/article/div[2]/div"} (Session info: chrome=114.0.5735.199); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace: Backtrace: GetHandleVerifier [0x0089A813+48355] (No symbol) [0x0082C4B1] (No symbol) [0x00735358] (No symbol) [0x007609A5] (No symbol) [0x00760B3B] (No symbol) [0x0078E232] (No symbol) [0x0077A784] (No symbol) [0x0078C922] (No symbol) [0x0077A536] (No symbol) [0x007582DC] (No symbol) [0x007593DD] GetHandleVerifier [0x00AFAABD+2539405] GetHandleVerifier [0x00B3A78F+2800735] GetHandleVerifier [0x00B3456C+2775612] GetHandleVerifier [0x009251E0+616112] (No symbol) [0x00835F8C] (No symbol) [0x00832328] (No symbol) [0x0083240B] (No symbol) [0x00824FF7] BaseThreadInitThunk [0x753A7D59+25] RtlInitializeExceptionChain [0x76F1B74B+107] RtlClearBits [0x76F1B6CF+191]

Exception ignored in: <function Chrome.del at 0x000002374012F380> Traceback (most recent call last): File "C:\Python311\Lib\site-packages\undetected_chromedriver__init.py", line 793, in del__ File "C:\Python311\Lib\site-packages\undetected_chromedriver__init__.py", line 748, in quit OSError: [WinError 6] The handle is invalid)

Sonusony201 commented 1 year ago

Any solution?

mendokismo commented 1 year ago

it work and open hashtag but after hashtag its close the window and show me error (Traceback (most recent call last): File "E:\auto coment\Instagram-Multi-Feature-Bot-master\Instagram-Multi-Feature-Bot-master\run.py", line 91, in main() File "E:\auto coment\Instagram-Multi-Feature-Bot-master\Instagram-Multi-Feature-Bot-master\run.py", line 77, in main post_links = bot.scrape_hashtag_posts(hashtag=args.hashtag) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\auto coment\Instagram-Multi-Feature-Bot-master\Instagram-Multi-Feature-Bot-master\InstagramBot.py", line 49, in scrape_hashtag_posts most_recent = self.driver.find_element(By.XPATH, '//div/div/div[2]/div/div/div/div[1]/div[1]/div[2]/section/main/article/div[2]/div') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 740, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 346, in execute self.error_handler.check_response(response) File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div/div/div[2]/div/div/div/div[1]/div[1]/div[2]/section/main/article/div[2]/div"} (Session info: chrome=114.0.5735.199); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception Stacktrace: Backtrace: GetHandleVerifier [0x0089A813+48355] (No symbol) [0x0082C4B1] (No symbol) [0x00735358] (No symbol) [0x007609A5] (No symbol) [0x00760B3B] (No symbol) [0x0078E232] (No symbol) [0x0077A784] (No symbol) [0x0078C922] (No symbol) [0x0077A536] (No symbol) [0x007582DC] (No symbol) [0x007593DD] GetHandleVerifier [0x00AFAABD+2539405] GetHandleVerifier [0x00B3A78F+2800735] GetHandleVerifier [0x00B3456C+2775612] GetHandleVerifier [0x009251E0+616112] (No symbol) [0x00835F8C] (No symbol) [0x00832328] (No symbol) [0x0083240B] (No symbol) [0x00824FF7] BaseThreadInitThunk [0x753A7D59+25] RtlInitializeExceptionChain [0x76F1B74B+107] RtlClearBits [0x76F1B6CF+191]

Exception ignored in: <function Chrome.del at 0x000002374012F380> Traceback (most recent call last): File "C:\Python311\Lib\site-packages\undetected_chromedriverinit.py", line 793, in del File "C:\Python311\Lib\site-packages\undetected_chromedriverinit.py", line 748, in quit OSError: [WinError 6] The handle is invalid)

I have the same problem... Anyone to help solve this crash?

Sonusony201 commented 1 year ago

its open hashtag but not doing comment till now

MatiNoto commented 9 months ago

xpaths are still broken. The code hasn't been updated for months. Is this project abandoned??