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 version
Accepts a deviant url along with its parent cookie, searches for the next page cursor, and returns the cursor part
if no next page or any other error returns 0

Deprecated 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 version
Accepts a deviant page source , searches for the next page cursor , and returns the cursor part
if 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 url
Some urls have a filter part which is not needed for the program to work, this function removes the filter part and returns the url
if no filter part is found returns the same url
Removes # from the url as well
converts http to https