Pre-Built APIS by DataKund
DataKund provides some of pre built APIS which are used mostly. These are public APIS, you can use these if don’t want to make your own.
Amazon APIs
Following are some of Amazon APIs:-
Twitter APIs
Following are some of Twitter APIs:-
Google APIs
Following are some of Google APIs:-
Scraper APIs
Basic APIS
You can use basic apis which selenium provides with this tool like opening a url, get pagesource, get current url etc. These are the functions:-
Open
It will open the url provided in the parameters.
dk_object.open(url)
datakund.open(url)
curl -X POST http://127.0.0.1:5000/open -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{"url":"https://www.google.com"}'
Get Page Title
It returns the title of page opened.
response=dk_object.get_page_title()
response=datakund.get_page_title()
curl -X POST http://127.0.0.1:5000/get_page_title -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'
{
"pagetitle":"amazon"
}
Get Page Source
It returns the pagesource of page opened.
response=dk_object.get_page_source()
response=datakund.get_page_source()
curl -X POST http://127.0.0.1:5000/get_page_source -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'
{
"pagesource":"<html><body>....."
}
Get Current Url
It returns the url of page opened.
response=dk_object.get_current_url()
response=datakund.get_current_url()
curl -X POST http://127.0.0.1:5000/get_current_url -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'
{
"url":"https://www.amazon.com"
}
Reload
It reloads the page opened.
dk_object.reload()
datakund.reload()
curl -X POST http://127.0.0.1:5000/reload -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'
Keypress
It perform the keypress passed.
dk_object.keypress("shoes")
datakund.keypress("shoes")
curl -X POST http://127.0.0.1:5000/keypress -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{"key":"shoes"}'
Scroll
It scrolls to the end of page.
dk_object.scroll()
datakund.scroll()
curl -X POST http://127.0.0.1:5000/scroll -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'
End
It ends the session and close the automated chromedriver.
Note
You will need to create dk object again after end()
.
dk_object.end()
datakund.end()
curl -X POST http://127.0.0.1:5000/end -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'
Quit
It quits the datakund application runing in background.
Note
You will need to import datakund library again to start datakund application.
dk_object.quit()
datakund.quit()
curl -X POST http://127.0.0.1:5000/quit -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{}'