Code:
class WP(seleniumrequests.PhantomJS):
def __init__(self):
self.wpurl='https://blah.org/download/release-archive/'
self.wppurl='https://blah.org/plugins/browse/popular/'
def wpscaper(self):
wpinit=seleniumrequests.PhantomJS(executable_path='phantomjs/bin/phantomjs')
wpinit.get(self.wpurl)
wpsoup=BeautifulSoup(wpinit.page_source, 'lxml')
print (wpsoup)
return wpsoup
def wppscaper(self):
wppinit=seleniumrequests.PhantomJS(executable_path = "phantomjs/bin/phantomjs")
wppinit.get(self.wppurl)
wppsoup=BeautifulSoup(wppinit.page_source, 'lxml')
print (wppsoup)
return wppsoup
In [85]: dir(WP)
Out[85]:
['__class__',
'__delattr__',
'__dict__',
'__doc__',
'__format__',
'__getattribute__',
'__hash__',
'__init__',
'__module__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'__weakref__',
'_unwrap_value',
'_wrap_value',
'add_cookie',
'application_cache',
'back',
'close',
'create_web_element',
'current_url',
'current_window_handle',
'delete_all_cookies',
'delete_cookie',
'desired_capabilities',
'execute',
'execute_async_script',
'execute_script',
'file_detector',
'find_element',
'find_element_by_class_name',
'find_element_by_css_selector',
'find_element_by_id',
'find_element_by_link_text',
'find_element_by_name',
'find_element_by_partial_link_text',
'find_element_by_tag_name',
'find_element_by_xpath',
'find_elements',
'find_elements_by_class_name',
'find_elements_by_css_selector',
'find_elements_by_id',
'find_elements_by_link_text',
'find_elements_by_name',
'find_elements_by_partial_link_text',
'find_elements_by_tag_name',
'find_elements_by_xpath',
'forward',
'get',
'get_cookie',
'get_cookies',
'get_log',
'get_screenshot_as_base64',
'get_screenshot_as_file',
'get_screenshot_as_png',
'get_window_position',
'get_window_size',
'implicitly_wait',
'log_types',
'maximize_window',
'mobile',
'name',
'orientation',
'page_source',
'quit',
'refresh',
'request',
'save_screenshot',
'set_page_load_timeout',
'set_script_timeout',
'set_window_position',
'set_window_size',
'start_client',
'start_session',
'stop_client',
'switch_to',
'switch_to_active_element',
'switch_to_alert',
'switch_to_default_content',
'switch_to_frame',
'switch_to_window',
'title',
'window_handles',
'wppscaper',
'wpscaper']
In [86]: dir(WP.wpscaper)
Out[86]:
['__call__',
'__class__',
'__cmp__',
'__delattr__',
'__doc__',
'__format__',
'__func__',
'__get__',
'__getattribute__',
'__hash__',
'__init__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__self__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'im_class',
'im_func',
'im_self']
In [87]: dir(WP.wppscaper)
Out[87]:
['__call__',
'__class__',
'__cmp__',
'__delattr__',
'__doc__',
'__format__',
'__func__',
'__get__',
'__getattribute__',
'__hash__',
'__init__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__self__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'im_class',
'im_func',
'im_self']