Other Functions

You can use basic functions which selenium provides with this library like opening a url, get pagesource, get current url etc. These are the functions:-

Open

It will open the url provided in the argument.

twitter.open(url)
Parameters

url (str) – Link which need to be opened

Returns

{}

Return type

dict

Get Page Title

It returns the title of page opened.

twitter.get_page_title()
Returns

{“pagetitle”:”twitter”}

Return type

dict

Get Page Source

It returns the pagesource of page opened.

twitter.get_page_source()
Returns

{“pagesource”:”pagesource”}

Return type

dict

Get Current Url

It returns the pagesource of page opened.

twitter.get_current_url()
Returns

{“url”:”url”}

Return type

dict

Reload

It reloads the page opened.

twitter.reload()
Returns

{}

Return type

dict

Keypress

It perform the keypress passed.

twitter.keypress(key)
Parameters

key (str) – Key which need to be pressed, e.g pagedown,arrowleft,enter

Returns

{}

Return type

dict

Scroll

It scrolls to the end of page.

twitter.scroll()
Returns

{}

Return type

dict

End

It ends the twitter session and close the automated chromedriver.

Note

You will need to create twitter object again after end().

twitter.end()
Returns

{}

Return type

dict

Quit

It quits the bot-studio application runing in background.

Note

You will need to import bot-studio library again to start application.

twitter.quit()
Returns

{}

Return type

dict