This module contains number of functions, which are used in the rest of the scrappers submodule.
Try to look for meta tag in given dom.
Parameters: |
|
---|---|
Returns: | str/default – Given encoding or default parameter if not found. |
Look for encoding in given html. Try to convert html to utf-8.
Parameters: | html (str) – HTML code as string. |
---|---|
Returns: | str – HTML code encoded in UTF. |
Return content of the first element in el_list or alt. Also return alt if the content string of first element is blank.
Parameters: |
|
---|---|
Returns: | str or alt – String representation of the content of the first element or alt if not found. |
Test whether url is absolute url (http://domain.tld/something) or relative (../something).
Parameters: |
|
---|---|
Returns: | bool – True if url is absolute, False if not. |
Normalize the url - from relative, create absolute URL.
Parameters: |
|
---|---|
Returns: | str/None – Normalized URL or None if url is blank. |
Generate function, which will check param is in html element.
This function can be used as parameter for .find() method in HTMLElement.
Generate function, which checks if given element contains tag_name with string content tag_content and also another tag named container_tag_name.
This function can be used as parameter for .find() method in HTMLElement.
Generate function, which checks whether the content of the tag matchs tag_content.
Parameters: |
|
---|
This function can be used as parameter for .find() method in HTMLElement.