Lately users screaming for help in the unfollow function not functioning.
Many users left followed but removed from follow pool.
@uluQulu your changes for core functional need to be tested by community before merging.
the following lines of code:
if following_status in ["Following", "Requested"]:
click_element(browser, follow_button) # click to unfollow
sleep(4) # TODO: use explicit wait here
confirm_unfollow(browser)
unfollow_state, msg = verify_action(browser, "unfollow", track,
username,
person, person_id, logger,
logfolder)
if unfollow_state is not True:
return False, msg
FAILS in the unfollow_state returns True while user button is still "Following".
As I did not have time to test the code and the logic seems correct my My solution was to scan the following and to compare it to the follow pool and ever follow "sync" and to reinsert last 14 days of users still followed.
UPDATE:
The button changed machnisem is not working correct.
elif action == "unfollow":
post_action_text = "//button[text()='Follow' or text()='Follow " \
"Back']"
button_change = explicit_wait(browser, "VOEL",
[post_action_text, "XPath"], logger, 7,
False)
the button changed return the element on instead of FAIL, this check if button_change return True for not Fail/None/[]/''.
The:
post_action_text = "//button[text()='Follow' or text()='Follow Back']"
find by xpath is failing;
Reason is :

Follow button exist in page !!! in suggested users!
ANY CODE THAT LOOK FOR GENERAL TEXT IS UNSAFE AND NEED TO BE AVOIDED
Please use only xpath structure.
get_following_status is also UNSAFE.
The only reason it works is because it found before other buttons that can contain the same text.
Hey @sionking , I'm glad you found some parts that can be improved. I just want to ask you to not use aggressive communication, we're all on the same boat, improving and helping each other to have the best software ever.
Locate DOM elements using text() function is ok, maybe we just need to adjust the xpath to get the first element
(//button[text()='text_here'])[1]
Explicit wait (Selenium) isn't dangerous, it's just one of the two ways we can handle waits[1]. The only issue is that we're using them together (explicit and implicit), as the document suggests, it's better to choose one approach that suits us better.
peace!
Hey @sionking , I'm glad you found some parts that can be improved. I just want to ask you to not use aggressive communication, we're all on the same boat, improving and helping each other to have the best software ever.
Locate DOM elements using text() function is ok, maybe we just need to adjust the xpath to get the first element
(//button[text()='text_here'])[1]Explicit wait (Selenium) isn't dangerous, it's just one of the two ways we can handle waits[1]. The only issue is that we're using them together (explicit and implicit), as the document suggests, it's better to choose one approach that suits us better.
peace!
"aggressive communication" ? what do you mean by that ?
"Explicit wait (Selenium) isn't dangerous," correct, but finding general case like a button that contain "Follow" is dangerous. we need to be explicit in the element we point to in this changing environment.
Hey @sionking , I'm glad you found some parts that can be improved. I just want to ask you to not use aggressive communication, we're all on the same boat, improving and helping each other to have the best software ever.
Locate DOM elements using text() function is ok, maybe we just need to adjust the xpath to get the first element
(//button[text()='text_here'])[1]Explicit wait (Selenium) isn't dangerous, it's just one of the two ways we can handle waits[1]. The only issue is that we're using them together (explicit and implicit), as the document suggests, it's better to choose one approach that suits us better.
peace!
Will first element be 1 or 0 in JS ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this problem still occurs, please open a new issue
Most helpful comment
Hey @sionking , I'm glad you found some parts that can be improved. I just want to ask you to not use aggressive communication, we're all on the same boat, improving and helping each other to have the best software ever.
Locate DOM elements using text() function is ok, maybe we just need to adjust the xpath to get the first element
Explicit wait (Selenium) isn't dangerous, it's just one of the two ways we can handle waits[1]. The only issue is that we're using them together (explicit and implicit), as the document suggests, it's better to choose one approach that suits us better.
peace!
[1] https://selenium-python.readthedocs.io/waits.html