Nathan Wailes - Blog - GitHub - LinkedIn - Patreon - Reddit - Stack Overflow - Twitter - YouTube
XPath
Related pages
Links
- http://zvon.org/xxl/XPathTutorial/General/examples.html
- Good tutorial
- rec'd here: http://stackoverflow.com/a/18423119/1513115
- http://genius.com/Mat-brown-xpath-is-actually-pretty-useful-once-it-stops-being-confusing-annotated
Advice
- Use Chrome's dev tools to test your XPath selectors quickly!
- Here's a particularly tricky selector:
haha_element = add_reaction_button.find_element_by_xpath('//span[@aria-label="Haha" and ' 'ancestor::div[@aria-label="Reactions"] and ' 'not(ancestor::div[contains(@class,"fb_content")])]')