1234567891011121314151617181920212223242526 |
- import sys
- sys.path.insert(0,'./kw_tools/web')
- import browser_common
- import rpyc
- from rpyc.utils.server import ThreadedServer # or ForkingServer
- class MyService(rpyc.Service):
- def __init__(self):
- self.jb=browser_common.JBrowser()
- #jb.set_profile_path('/home/jared/.config/google-chrome/Default/')
- self.jb.set_profile_path('"/home/jared/.config/google-chrome/"')
- def get_url(self,url):
- self.jb.get(url)
- driver=self.jb.get_driver()
- src=driver.page_source
- print(src)
- #'https://data.similarweb.com/api/v1/data?domain=yahoo.com.tw'
- if __name__ == "__main__":
- server = ThreadedServer(MyService, port = 12345)
- server.start()
|