MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / create_sync_task

Method create_sync_task

botasaurus_api/botasaurus_api/__init__.py:87–104  ·  view source on GitHub ↗

Submits a synchronous task to the server. :param data: The data to be processed by the task. :param scraper_name: The name of the scraper to use for the task. If not provided, the server will use the default scraper. :return: The created task object.

(self, data, scraper_name=None)

Source from the content-addressed store, hash-verified

85 return response_data
86
87 def create_sync_task(self, data, scraper_name=None):
88 """
89 Submits a synchronous task to the server.
90
91 :param data: The data to be processed by the task.
92 :param scraper_name: The name of the scraper to use for the task. If not provided, the server will use the default scraper.
93 :return: The created task object.
94 """
95 url = self._make_api_url("api/tasks/create-task-sync")
96 payload = {
97 "data": data,
98 "scraper_name": scraper_name,
99 }
100 response = requests.post(url, json=payload)
101 _raise_for_status(response)
102 response_data = response.json()
103 self._write_json("create_sync_task", response_data) # Call write_json with method name
104 return response_data
105
106 def create_async_tasks(self, data_items, scraper_name=None):
107 """

Callers

nothing calls this directly

Calls 3

_make_api_urlMethod · 0.95
_write_jsonMethod · 0.95
_raise_for_statusFunction · 0.85

Tested by

no test coverage detected