alpdias / instagram-bot

🤖 Python bot to view stories, like and comment on Instagram
GNU General Public License v3.0
81 stars 18 forks source link

When try to start the bot don't get "way" #9

Closed joost-heijden closed 3 years ago

joost-heijden commented 3 years ago

Hi, when i try to start the bot, i can't import the Gecko path. Can you tell me what i need to do?

instagrambot

alpdias commented 3 years ago

Hello, you need to enter the directory corresponding to your operating system and unzip the geckodriver, that's all, there is no need to move or anything, just unzip it on the spot

joost-heijden commented 3 years ago

I already unzipped the Geckodriver on the spot.

What i use is: cd C:\Users\user name\Downloads\instagram-bot-master\src\

After that i use: python botInstagram.py

And then i get the screenshot above.

There is no way to drop the Configuration, and put the path for the Geckodriver

alpdias commented 3 years ago

Yes, there is a way, before it was like that, but as people got confused when it was time to put the path, I let him look for it myself, so I find it strange to be returning this error, try running the script 'botError.py' and show me what he returns you.

joost-heijden commented 3 years ago

When i try to activate "botError.py" it opens the Instabot start file.

bot-error

And without python, it opens Python. And it shows me the same: geckodriver

alpdias commented 3 years ago

Yes, the 'botError.py' file starts all other files, but without excess errors, which brings the real reason for the error that is happening. Now if you just want to put the geckodriver path directly in the code change this part as below the variables described as way and put the path to the geckodriver.

image

joost-heijden commented 3 years ago

Get another error:

Traceback (most recent call last):
  File "botInstagram.py", line 14, in <module>
    import botStories
  File "C:\Users\username\Downloads\instagram-bot-master\src\botStories.py", line 33
    way = Path('C:\Users\username\Downloads\instagram-bot-master\geckodriver\windows\')
                                                                                              ^
SyntaxError: EOL while scanning string literal

The path that i put in the file is: C:\Users\Username\Downloads\instagram-bot-master\geckodriver\windows\

If you wanna know if i extract the zipfile: yes i did

    # check the system
    if mySystem == 'Linux': 
        mySystem = 'clear'
        way = Path('C:geckodriver/linux/geckodriver-v0.26.0-linux64') # path to the file
        geckoFile = way / 'geckodriver' # way to geckodriver

    else:
        mySystem = 'cls'
        way = Path('C:\Users\username\Downloads\instagram-bot-master\geckodriver\windows\') 
        geckoFile = way / 'geckodriver.exe'

Even try to change the path for Windows (where i'm working on)

alpdias commented 3 years ago

Hello, sorry for the delay in the response, but try something like the image below, passing the direct path to the geckodriver and executable, just like in the image. I ended up also passing the wrong variable to the correct one would be geckoFile.

image

joost-heijden commented 3 years ago

I make a change, like you said. Now i get another error:

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

My code: else:

        mySystem = 'cls'
        way = Path('C:\Users\username\Downloads\instagram-bot-master\geckodriver\windows\geckodriver-v0.26.0-win64\checkodrive.exe') 
        geckoFile = way / 'geckodriver.exe'

And to be sure: i need to change the path in all these files: botDraw.py botError.py botLike.py botStories.py

alpdias commented 3 years ago

Instead of putting the path in the way variable, put it in the geckoFile variable. The variable way uses the Path library so it is returning this error, so return it to the original and put your path directly in geckoFile.

joost-heijden commented 3 years ago

Again, same error:

Loading...

DRIVER ERROR! Check installed drive or path.
UNEXPECTED ERROR ON LOGIN, please try again and verify your connection!
UNEXPECTED ERROR ON HASHTAG PAGE, please try again and verify your connection!
UNEXPECTED ERROR ON COMMENT, please try again and verify your connection!
    else:
        mySystem = 'cls'
        way = Path('geckodriver/windows') 
        geckoFile = way / 'C:/Users/username/Downloads/instagram-bot-master/geckodriver/windows/geckodriver-v0.26.0-win64/'
alpdias commented 3 years ago

Follow this way, only the path in the variable

image

joost-heijden commented 3 years ago
    else:
        mySystem = 'cls'
        way = Path('geckodriver/windows') 
        geckoFile = way / 'C:\Users\username\Downloads\instagram-bot-master\geckodriver\windows\geckodriver-v0.26.0=win64\geckodriver.exe'

Still this error:

DRIVER ERROR! Check installed drive or path.
UNEXPECTED ERROR ON LOGIN, please try again and verify your connection!
UNEXPECTED ERROR ON HASHTAG PAGE, please try again and verify your connection!
UNEXPECTED ERROR ON COMMENT, please try again and verify your connection!