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.
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.
weskerfoot(Migrated from github.com)
reviewed 6 years ago
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.
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.
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 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.
Yeah for sure, it can be refactored I think
On Thu, May 30, 2019, 4:30 PM Joseph Bennett <notifications@github.com>
wrote:
> *@jsmbennett* commented on this pull request.
> ------------------------------
>
> In deletefb/tools/wall.py
> <https://github.com/weskerfoot/DeleteFB/pull/44#discussion_r289159963>:
>
> > @@ -44,7 +44,10 @@ def delete_posts(driver,
> try:
> delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"FeedDeleteOption\"]")
> except SELENIUM_EXCEPTIONS:
> - 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:
>
> 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.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/weskerfoot/DeleteFB/pull/44?email_source=notifications&email_token=AAC4L3YEIHCLXDEQQWRRBNLPYA2ORA5CNFSM4HRF5M3KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2FVUPY#pullrequestreview-244013631>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAC4L34OTN6YFK5ELR3IXBLPYA2ORANCNFSM4HRF5M3A>
> .
>
try:
delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"HIDE_FROM_TIMELINE\"]")
except SELENIUM_EXCEPTIONS:
delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"UNTAG\"]")
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.try:
delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"HIDE_FROM_TIMELINE\"]")
except SELENIUM_EXCEPTIONS:
delete_button = menu.find_element_by_xpath("//a[@data-feed-option-name=\"UNTAG\"]")
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.
Yeah for sure, it can be refactored I think
On Thu, May 30, 2019, 4:30 PM Joseph Bennett notifications@github.com
wrote:
4f910ebee0
.