I Have a selenium bot I'm working on that works fine. But I can't find the accurate syntax I shall use to grep the body element. To reach an element I generally just use something like this:
canvas = driver.find_element("id", "canvas")
But for the body element, no one of the regular syntax works. I've tried:
find element_by("tagName", "body")
find element_by(by="tagName", value="body")
and different versions of tag_name, tagName, and so forth. I Can't use the By. since I have not imported it yet, which is a piece of cake anyway, but should it be necessary and would that help?
i suggest to use xpath
find_element_by_xpath()as it is well known and comparably easy to use.For a first introduction have a look at:
W3-Schools_xpath_tutorial
For identifiying the HTML elements see:
octoparse_locate_xpath
And for you future xpath´s there is this cool cheatsheet:
devhints_xpath