()
| 12 | |
| 13 | |
| 14 | def test_selector(): |
| 15 | request = Request("https://www.baidu.com?a=1&b=2", data={}, params=None) |
| 16 | response = request.get_response() |
| 17 | print(response) |
| 18 | |
| 19 | print(response.xpath("//a/@href")) |
| 20 | print(response.css("a::attr(href)")) |
| 21 | print(response.css("a::attr(href)").extract_first()) |
| 22 | |
| 23 | content = response.re("<a.*?href='(.*?)'") |
| 24 | print(content) |
| 25 | |
| 26 | |
| 27 | def test_from_text(): |
nothing calls this directly
no test coverage detected