MCPcopy Create free account
hub / github.com/Boris-code/feapder / test_selector

Function test_selector

tests/test_request.py:14–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def 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
27def test_from_text():

Callers

nothing calls this directly

Calls 5

get_responseMethod · 0.95
RequestClass · 0.90
xpathMethod · 0.80
cssMethod · 0.80
reMethod · 0.45

Tested by

no test coverage detected