watchme.watchers.urls package

Submodules

watchme.watchers.urls.tasks module

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

watchme.watchers.urls.tasks.download_task(url, **kwargs)[source]

a simple task to use requests to get a url. By default, we return the raw response.

Parameters
  • REQUIRED – url: a url to download (stream)

  • OPTIONAL – write_format: to change from default “w” disable_ssl_check: set to anything to not verify (not recommended)

watchme.watchers.urls.tasks.get_task(url, **kwargs)[source]

a simple task to use requests to get a url. By default, we return the raw response.

Parameters
  • REQUIRED – url: a url to return the page for

  • OPTIONAL – regex: a regular expression to search the text for (not used w/ json) save_as: return the result to save as json

watchme.watchers.urls.tasks.get_url_selection(url, **kwargs)[source]

select some content from a page dynamically, using selenium.

Parameters

kwargs (a dictionary of key, value pairs provided by the user)

watchme.watchers.urls.tasks.post_task(url, **kwargs)[source]

a simple task to use requests to post to. By default, we return json.

Parameters

REQUIRED – url: a url to post to

Module contents

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

class watchme.watchers.urls.Task(name, params=None, **kwargs)[source]

Bases: watchme.tasks.TaskBase

export_func()[source]

this function should return the correct task (from the tasks.py in the same folder) based on some logic of the params that are given by the user (self.params). If there is only one kind of function for the task, it’s fairly easy to import and return it here. This function should take no arguments, but instead use the self.params already provided in the client.

required_params = ['url']