SeleniumBase/help_docs/html_inspector.md

36 lines
1.3 KiB
Markdown
Raw Normal View History

2022-11-05 13:27:22 +08:00
<!-- SeleniumBase Docs -->
2022-11-08 02:52:25 +08:00
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) The HTML Inspector 🕵️
2021-03-27 05:51:51 +08:00
2022-11-08 02:52:25 +08:00
🕵️ <b>HTML Inspector</b> provides useful info about a web page.
2021-03-27 05:51:51 +08:00
2022-11-08 02:52:25 +08:00
🕵️ (<i>Based on: [github.com/philipwalton/html-inspector](https://github.com/philipwalton/html-inspector)</i>)
2021-03-27 05:51:51 +08:00
2022-11-08 02:52:25 +08:00
🕵️ Example: [examples/test_inspect_html.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_inspect_html.py) (Chromium-only)
2021-03-27 05:51:51 +08:00
```python
from seleniumbase import BaseCase
2023-03-22 00:49:57 +08:00
BaseCase.main(__name__, __file__)
2021-03-27 05:51:51 +08:00
class HtmlInspectorTests(BaseCase):
def test_html_inspector(self):
self.open("https://xkcd.com/1144/")
self.inspect_html()
```
--------
```bash
2023-03-22 00:49:57 +08:00
pytest test_inspect_html.py
2021-03-27 05:51:51 +08:00
============== test session starts ==============
* HTML Inspection Results: https://xkcd.com/1144/
2022-08-19 03:52:00 +08:00
⚠️ 'property' is not a valid attribute of the <meta> element.
⚠️ Do not use <div> or <span> elements without any attributes.
⚠️ 'srcset' is not a valid attribute of the <img> element.
2023-04-12 07:36:25 +08:00
⚠️ The 'border' attribute is no longer valid on the <img> element.
⚠️ The <center> element is obsolete.
2022-08-19 03:52:00 +08:00
⚠️ The id 'comicLinks' appears more than once in the document.
2021-03-27 05:51:51 +08:00
* (See the Console output for details!)
```