(crawler)
| 155 | print_result(result) |
| 156 | |
| 157 | def targeted_extraction(crawler): |
| 158 | # Using a CSS selector to extract only H2 tags |
| 159 | cprint("\n🎯 [bold cyan]Targeted extraction: Let's use a CSS selector to extract only H2 tags![/bold cyan]", True) |
| 160 | result = crawler.run( |
| 161 | url="https://www.nbcnews.com/business", |
| 162 | css_selector="h2" |
| 163 | ) |
| 164 | cprint("[LOG] 📦 [bold yellow]CSS Selector (H2 tags) result:[/bold yellow]") |
| 165 | print_result(result) |
| 166 | |
| 167 | def interactive_extraction(crawler): |
| 168 | # Passing JavaScript code to interact with the page |
no test coverage detected
searching dependent graphs…