libs.urlextractor module#
- libs.urlextractor.next_cursor_requests(base_url: str, cookie) str [source]#
- Parameters:
base_url (str) – Deviant art page url
cookie (cookie) – cookie of the parent page
- Returns:
next page cursor
- Return type:
str
- Example:
“/tag/steamprofile?cursor=MTQwYWI2MjA9NCY1OTBhY2FkMD03MiZkMTc0YjZiYz1OJTJGQQ”
Made for requests versionAccepts a deviant url along with its parent cookie, searches for the next page cursor, and returns the cursor partif no next page or any other error returns 0Deprecated since version 0.0.1:
Use :func:`deviantartapi.nextcursor_selenium` instead outdated since Deviantart changed their website and introduced login system,also the requests version doesn’t render js
- libs.urlextractor.next_cursor_selenium(page_data: str) str [source]#
- Parameters:
page_data (str) – raw page source data of the page
- Returns:
next page cursor
- Return type:
str
- Exception:
IndexError - if no next page or any other error returns 0
- Example:
“/tag/steamprofile?cursor=MTQwYWI2MjA9NCY1OTBhY2FkMD03MiZkMTc0YjZiYz1OJTJGQQ”
Made for selenuim versionAccepts a deviant page source , searches for the next page cursor , and returns the cursor partif no next page or any other error returns 0
- libs.urlextractor.url_cleaner(steam_url: str) str [source]#
- Parameters:
steamurl (str) – Steam url
- Returns:
Steam url without filter tag
- Return type:
str
Accepts a steam url and removes the filter part of the url and returns the urlSome urls have a filter part which is not needed for the program to work, this function removes the filter part and returns the urlif no filter part is found returns the same urlRemoves # from the url as wellconverts http to https