1
0

selserver.py 697 B

1234567891011121314151617181920212223242526
  1. import sys
  2. sys.path.insert(0,'./kw_tools/web')
  3. import browser_common
  4. import rpyc
  5. from rpyc.utils.server import ThreadedServer # or ForkingServer
  6. class MyService(rpyc.Service):
  7. def __init__(self):
  8. self.jb=browser_common.JBrowser()
  9. #jb.set_profile_path('/home/jared/.config/google-chrome/Default/')
  10. self.jb.set_profile_path('"/home/jared/.config/google-chrome/"')
  11. def get_url(self,url):
  12. self.jb.get(url)
  13. driver=self.jb.get_driver()
  14. src=driver.page_source
  15. print(src)
  16. #'https://data.similarweb.com/api/v1/data?domain=yahoo.com.tw'
  17. if __name__ == "__main__":
  18. server = ThreadedServer(MyService, port = 12345)
  19. server.start()