Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Try to use untag button if delete or hide is not an option #44

Merged
merged 1 commit into from
Jun 1, 2019

Conversation

weskerfoot
Copy link
Owner

No description provided.

delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"HIDE_FROM_TIMELINE\"]")
try:
delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"HIDE_FROM_TIMELINE\"]")
except SELENIUM_EXCEPTIONS:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll test this when I get home from work today, I believe this should do the trick.

That being said, I wonder if it makes more sense to find all possible <a data-feed-option-name> elements at once in a list, and then check loop over their option names in precendence of DELETE, HIDE, UNTAG, along with any other tags you may discover.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that makes sense. I wanted to make sure it didn't break anything first, but I think it should be ok to just check them in a loop and then use the first one that actually exists in priority.

@weskerfoot
Copy link
Owner Author

weskerfoot commented May 31, 2019 via email

@weskerfoot weskerfoot merged commit 4f910eb into master Jun 1, 2019
@weskerfoot weskerfoot deleted the untag branch June 1, 2019 01:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants