File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -208,3 +208,26 @@ The continue.html link can be located like this::
208
208
continue_link = driver.find_element_by_link_text('Continue')
209
209
continue_link = driver.find_element_by_partial_link_text('Conti')
210
210
211
+
212
+ Locating Elements by Tag Name
213
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214
+
215
+ Use this when you want to locate an element by tag name. With this
216
+ strategy, the first element with the give tag name will be returned.
217
+ If no element has a matching tag name, a ``NoSuchElementException ``
218
+ will be raised.
219
+
220
+ For instance, conside this page source::
221
+
222
+ <html>
223
+ <body>
224
+ <h1>Welcome</h1>
225
+ <p>Site content goes here.</p>
226
+ </body>
227
+ <html>
228
+
229
+ The heading (h1) element can be located like this::
230
+
231
+ heading1 = driver.find_element_by_tag_name('h1')
232
+
233
+
You can’t perform that action at this time.
0 commit comments