rileypeterson / Depop

Program to follower and unfollow users.
MIT License
11 stars 8 forks source link

No longer works with Depop website update. #7

Closed OZCAP closed 5 years ago

OZCAP commented 5 years ago

Depop has recently updated its website, causing this script to suddenly stop working.

When 'Following', the program clicks the 'Followers' element and then just pauses there.

When 'Unfollowing', the program clicks the 'Following' element and then scrolls but it does not click any of the 'Following' buttons.

Maybe this fix is simple and is just as a result of Depop renaming some elements of the website?

rileypeterson commented 5 years ago

Should have some time this week to investigate this

gustininho commented 5 years ago

Thanks!

gustininho commented 5 years ago

@rileypeterson any news?

rileypeterson commented 5 years ago

No news. I did not end up having/making time. I apologize for that and feel bad. I'll post here some updates when I have some, but don't want to make any promises about when they will be made.

jayb7 commented 5 years ago

Please fix this, you angel! Great tool

Deorbiting commented 5 years ago

Sorry to pester But any updates?

rileypeterson commented 5 years ago

I finally got some time to work on this. Unfortunately, a challenge for me is that I do not have an account to login to. Nevertheless, I believe I've made some progress.

Can any of you test the following for me?

  1. Copy the following code (or git clone and then checkout the bugfix2019 branch): https://github.com/rileypeterson/Depop/blob/bugfix2019/depop_github.py
  2. Replace the chrome_path and home_user variables with your values as before.
  3. Then login and try running the following mode (it should ask for a user to follow from e.g. gsvwear). I have not yet worked on the unfollowing mode.

What I'm expecting will happen is that it will go through and follow users for 30 seconds. Can anyone confirm that this works for them? If not, please post the traceback. If you have questions about how to test this please ask.

@Deorbiting @TastyMilk @gustininho @jayb7 @RachelDuffin

gustininho commented 5 years ago

(1) Capture1 (2) capture

So I have ran it. It worked a couple of times properly as you expected. However, it faced 2 different errors. One of them is really simple and is minor: once the followers load too long the program shows the problem that array is out of index (picture (2)). So I guess there should be some safeties.

Second error is unknown for me, while following users it stopped and showed traceback as in picture(1). I think but I am not sure that it may be when programs tries to follow user which is already followed.

One way to solve this problem to use some text files which could store data of followed people.

Also it would be a great program if it could dig deeper into followers and run for a long time without humans touch .

One way or another I am grateful to you and look forward to updates!

@rileypeterson

gustininho commented 5 years ago

@rileypeterson

Any updates of the program?

rileypeterson commented 5 years ago

@gustininho I believe I've handled the errors you describe and I'd be glad if you tried it again. You can follow the same instructions as before (i.e. run from the hotfix branch). Let me know how it goes.

Also it would be a great program if it could dig deeper into followers and run for a long time without humans touch .

Once I can get it to run consistently for a single follower list I can have it run for a longer time across more follower lists. But first I want to make sure it works consistently for a single follower list.

gustininho commented 5 years ago

@rileypeterson So I have ran the program and the following process is now fluent without any errors. However, I think some parts of code do not function. It is not an error but a warning. When program starts user gets to write an input ("First username to use:"), the issue is that there is no difference what user enters to this field or even leaves it as a blank there is no difference in later program work. So the issue is that it does not navigate to the entered person's account.

I made a little fix which works but is not optimal. minorfix_oldfinds I just created another input which works perfectly. (but that means that some piece of code is not functioning)

There was another small issue when pressing on login did not work in some cases (I think that depop has slightly updated the html of that page). But I have found very simple solution and I think that it is enough. issuelogin issuelogin_fixed

Overall, the following bot works perfectly 0 bugs regarding following process. The only thing that you should take a look at is navigation of my abovementioned issue.

Also, if we look in the future I think that the bot would be 1000x times better if it used invisible driver instead of chromedriver something like PhantomJS or HTMLUnit. Unfortunately, I do not have yet enough knowledge for such tasks. So the maximum I can do is suggest :)

Thanks for your app!

rileypeterson commented 5 years ago

Ok, I made these fixes (https://github.com/rileypeterson/Depop/commit/708abc7ce6c47c671d031f85d6e569abff23e546)

That's a good point about navigating directly to the login url. I did that.

I will working on "chaining" users so that it's self sufficient.

Regarding switching to some headless browser: Maybe it will happen eventually, as of right now being able to debug visually is very helpful so that is why I'm using it.

gustininho commented 5 years ago

@rileypeterson Good point about the debugging. Nice job! I will be waiting!

rileypeterson commented 5 years ago

@gustininho Go ahead and give the most recent version a shot. Something I've noticed is that it works best when the browser window is actually in view on my computer (though not necessarily focused). Not really sure why that is, but I see better performance when I have the window visible. 🤷‍♂

I added some retry behavior for various errors. If you get an error please post the screenshot.

Also reminding you of the license and warning

gustininho commented 5 years ago

@rileypeterson

The following algorhytm works perfectly. Retry behaviour works very well. Program while chaining quite often fails to get stats but when retries it works nicely.

Only got this error while getting stats. (The most recent version) image

Today I have tested a previous version and 1-2 times I got this error. But I guess you are already aware of it. Because the newer version has not faced any errors like this yet. CaptureO

rileypeterson commented 5 years ago

@gustininho

Only got this error while getting stats. (The most recent version) image


Because the newer version has not faced any errors like this yet.

Which of these is true? Are you still getting this error in the most recent version?? I just added a brief pause to hopefully alleviate this error.

If everything is going fine, I will work on the unfollowing part next.

gustininho commented 5 years ago

@rileypeterson

Nah I have tested today and it worked pleasantly without any problems. Nice! So now you should work on unfollowing mode. I look forward to updates :)

rileypeterson commented 5 years ago

@gustininho

I just wrote a sample portion of the unfollowing code (it should only run for 60 seconds). This part is significantly more difficult to test for me since I don't have an account (though also much more straightforward to code...). Can you let me know how it goes?

gustininho commented 5 years ago

@rileypeterson Hello, sorry for the delay. I have tested the unfollowing mode and unfortunately it does not work. The first following are unfollowed (5 people) and then the program only uses slider and slides down (huge steps) without pressing buttons.

Also, the place number that should show the amount of unfollowed users displays 0 everytime a person is unfollowed.

gustininho commented 5 years ago

@uzair166

Hi, the symptoms that you are describing were happening on the previous version. You should use the newest one.

You should check whether you are using the right branch of this project. It should be this one: https://github.com/rileypeterson/Depop/tree/bugfix2019

rileypeterson commented 5 years ago

@uzair166 that code is from the master branch, not the bugfix2019 branch.

@gustininho ok I will try and figure it out when I’ve got time

uzair166 commented 5 years ago

Ohh yes I have just realised! I apologise for my stupidity! Thanks so much:)

uzair166 commented 5 years ago

@rileypeterson If you need an account to test it with, if you give me your email I can email you some account details to test it with :)

uzair166 commented 5 years ago

@gustininho I managed to find a "hacky" solution to get the unfollowing working using the code in the master branch!

If you change the unfollowing code in the master branch to the following

image

and then when you run the program and select unfollowing it will ask you to input the data word. Then you go the chrome window that opened up and inspect element on one of the "following" buttons and copy and paste the classname on the a tag (shown in the image below)

image

It should then unfollow everyone! It managed to work for my account and I was following over 6000 :)

It's not a perfect solution but it works until we get a better one

rileypeterson commented 5 years ago

@uzair166 I appreciate the offer, but don't want to do that. It sounds like you've got a temporary fix working which is great! It will probably be mid/late June before you can expect me to work on this.

gustininho commented 5 years ago

@rileypeterson

Any news regarding this amazing tool?

rileypeterson commented 5 years ago

@gustininho thank you for reminding me. I will work on it within the next 7 days (hold me to it!). I had a difficult month personally so couldn't bring myself to work on it. I'll push something to master and notify you here when I do!

gustininho commented 5 years ago

@rileypeterson

Haha! My appreciation is endless!

rileypeterson commented 5 years ago

@gustininho try the unfollowing mode on the most recent commit to the bugfix2019 branch and let me know how it goes, if there are errors please post screen shots, otherwise explain the behavior you see... I'm expecting it to unfollow for 60 seconds and then exit.

rileypeterson commented 5 years ago

@gustininho @uzair166 Can one of you try the unfollowing mode for me?

gustininho commented 5 years ago

I will be able to do that in a few days period

gustininho commented 5 years ago

@rileypeterson

Sorry, I had a very busy time so I couldn't contribute.

Now I have switched to Ubuntu and while running this program I face some errors. I am not sure if the issue is somewhere in my Ubuntu python or it is in the program.

These are two abovementioned issues. If I try to run it I face this issue: (1)Screenshot from 2019-09-16 18-53-29

Once I delete this code :

Store credentials (as dictionary) in config.json, if you want

try: with open("config.json") as f: config_json = json.load(f) except FileNotFoundError:

I try to run the program once again and I get to pick which mode to use. Then when I write "following" Chome is being initiated I receive this error:

(2)Screenshot from 2019-09-16 18-38-18

Most likely that I am doing something wrong but I would like you to take a look at it. P.S. the same errors are for both modes not just only following

rileypeterson commented 5 years ago

You might need to just do python3 instead of python

The default version of python on Ubuntu is python 2

Let me know if that works

gustininho commented 5 years ago

@rileypeterson

Hahaha! Thanks Riley! Silly me, I have checked whether the version of Python is updated but never checked if I'm using the right version. The program works without any issues. Thanks a million!

rileypeterson commented 5 years ago

Great!