GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Crawlee for Python
  • Docs
  • API
  • Changelog
  • Blog
  • Next
  • 0.6
  • Autoscaling
  • Browser management
  • Configuration
  • Crawlers
  • Crawling contexts
  • Errors
  • Event data

This view

  • Original page
  • New address

GeezerVison is showing crawlee.dev — AbstractHttpParser | API | Crawlee for Python · Fast, reliable Python web crawlers.

Version: 1.11

Parser used for parsing HTTP response and inspecting parsed result to find links or detect blocking.

Hierarchy

  • AbstractHttpParser
    • BeautifulSoupParser
    • NoParser
    • ParselParser

Index

Methods

  • find_links
  • is_blocked
  • is_matching_selector
  • parse
  • parse_text
  • select

Methods

find_links

  • find_links(parsed_content, selector, attribute): Iterable[str]
  • Overrides AbstractHttpParser.find_links

    Find all links in result using selector.


    Parameters

    • parsed_content: TParseResult

      Parsed HTTP response. Result of parse method.

    • selector: str

      String used to define matching pattern for finding links.

    • attribute: str

      Which node attribute to extract the links from.

    Returns Iterable[str]

    Iterable of strings that contain found links.

is_blocked

  • is_blocked(parsed_content): BlockedInfo
  • Overrides AbstractHttpParser.is_blocked

    Detect if blocked and return BlockedInfo with additional information.

    Default implementation that expects is_matching_selector abstract method to be implemented. Override this method if your parser has different way of blockage detection.


    Parameters

    • parsed_content: TParseResult

      Parsed HTTP response. Result of parse method.

    Returns BlockedInfo

    BlockedInfo object that contains non-empty string description of reason if blockage was detected. Empty string in reason signifies no blockage detected.

is_matching_selector

  • is_matching_selector(parsed_content, selector): bool
  • Overrides AbstractHttpParser.is_matching_selector

    Find if selector has match in parsed content.


    Parameters

    • parsed_content: TParseResult

      Parsed HTTP response. Result of parse method.

    • selector: str

      String used to define matching pattern.

    Returns bool

    True if selector has match in parsed content.

parse

  • async parse(response): TParseResult
  • Overrides AbstractHttpParser.parse

    Parse HTTP response.


    Parameters

    • response: HttpResponse

      HTTP response to be parsed.

    Returns TParseResult

    Parsed HTTP response.

parse_text

  • async parse_text(text): TParseResult
  • Overrides AbstractHttpParser.parse_text

    Parse text containing html.


    Parameters

    • text: str

      String containing html.

    Returns TParseResult

    Parsed text.

select

  • async select(parsed_content, selector): Sequence[TSelectResult]
  • Overrides AbstractHttpParser.select

    Use css selector to select page element and return it.


    Parameters

    • parsed_content: TParseResult

      Content where the page element will be located.

    • selector: str

      Css selector used to locate desired html element.

    Returns Sequence[TSelectResult]

    Selected element.

Page Options
Hide Inherited
  • find_links
  • is_blocked
  • is_matching_selector
  • parse
  • parse_text
  • select
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.