Request

class Request(url, params=None, headers=None, *, timeout=None, max_retries=5, use_proxy=False, get_method='get', head_method='head', **request_kwargs)[source]
RELOAD_ATTRS = ('response', 'head_response', 'success', 'head_success', 'text', 'json', 'bs', 'browser', 'page')
RESET_ATTRS = ('response', 'head_response', 'success', 'head_success', 'text', 'json', 'bs', 'browser', 'page')
coroutine all(requests, *, timeout=None, predicate=None)[source]

Get all requests that fulfill predicate

Parameters
Return type

List[Request]

Returns

List of Requests that fulfilled predicate

browser
bs
Return type

BeautifulSoup

classmethod create_soup(html)[source]
Return type

BeautifulSoup

coroutine first(requests, *, timeout=None, predicate=None)[source]

Get first request that fulfills predicate (or None)

Parameters
Return type

Optional[Request]

Returns

Optional Request instance

classmethod from_state(state)[source]
Return type

Request

head_response
Return type

ClientResponse

head_success
Return type

bool

headers
json
Return type

Dict[str, Any]

page
coroutine perform_request(self, method, **kwargs)[source]
Return type

ClientResponse

raw_finalised_url
Return type

str

redirected_url
Return type

URL

reload()[source]
reset(attrs=None)[source]
Return type

None

response
Return type

ClientResponse

coroutine staggered_request(self, method, url, **kwargs)[source]
Return type

ClientResponse

state

Get a json serializable dictionary containing the state of this request.

Return type

dict

Returns

Dict

success
Return type

bool

text
Return type

str

track_telemetry(url, method, using_proxy)[source]
Return type

None

coroutine try_req(req, *, predicate=None)[source]

Return request if it passes predicate, otherwise None

Parameters
Return type

Optional[Request]

Returns

req if it passes predicate, else None

url
Return type

str

yarl
class UrlFormatter(fields=None, proxy_domains=None)[source]
add_field(key, value, *, use_proxy=None)[source]
Return type

None

add_fields(fields=None, **kwargs)[source]
Return type

None

add_pool(pool, *, use_proxy=None)[source]
Return type

None

coroutine get_value(self, key, args, kwargs)[source]
Return type

Any

should_use_proxy(url)[source]
Return type

bool

use_proxy(key, use=True)[source]