Skip to content

Commit 9a4da5d

Browse files
committed
Add a help doc for the HTML Inspector
1 parent d178452 commit 9a4da5d

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

help_docs/html_inspector.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> The HTML Inspector</h2>
2+
3+
🔵 <b>HTML Inspector</b> provides useful info about a web page.
4+
5+
🔵 (<i>Based on: [github.com/philipwalton/html-inspector](https://github.com/philipwalton/html-inspector)</i>)
6+
7+
🔵 Example: [examples/test_inspect_html.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_inspect_html.py) (Chromium-only)
8+
9+
```python
10+
from seleniumbase import BaseCase
11+
12+
class HtmlInspectorTests(BaseCase):
13+
def test_html_inspector(self):
14+
self.open("https://xkcd.com/1144/")
15+
self.inspect_html()
16+
```
17+
18+
--------
19+
20+
```bash
21+
pytest test_inspect_html.py
22+
============== test session starts ==============
23+
24+
* HTML Inspection Results: https://xkcd.com/1144/
25+
X - https://xkcd.com/1144/ - Access to XMLHttpRequest at 'https://xkcd.com/usBanner' (redirected from 'https://c.xkcd.com/xkcd/news') from origin 'https://xkcd.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
26+
X - https://xkcd.com/usBanner - Failed to load resource: net::ERR_FAILED
27+
X - 'property' is not a valid attribute of the <meta> element.
28+
X - Do not use <div> or <span> elements without any attributes.
29+
X - The 'alt' attribute is required for <img> elements.
30+
X - The 'border' attribute is no longer valid on the <img> element and should not be used.
31+
X - 'srcset' is not a valid attribute of the <img> element.
32+
X - The <center> element is obsolete and should not be used.
33+
X - <script> elements should appear right before the closing </body> tag for optimal performance.
34+
X - The id 'comicLinks' appears more than once in the document.
35+
* (See the Console output for details!)
36+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ nav:
115115
- Docker Start Guide: integrations/docker/ReadMe.md
116116
- Using Safari Driver: help_docs/using_safari_driver.md
117117
- Shadow DOM Support: help_docs/shadow_dom.md
118+
- The HTML Inspector: help_docs/html_inspector.md
118119
- macOS Hidden Files: help_docs/hidden_files_info.md
119120
- MySQL Instructions: help_docs/mysql_installation.md
120121
- Demo Pages:

0 commit comments

Comments
 (0)