Learn practical skills, build real-world projects, and advance your career

xmlrpc and http.server

  • xmlrpc
    • xmlrpc.server
    • xmlrpc.client
  • python -m http.server

常用注册函数

  • sh
  • get_hdfs_data
# 执行远程机器程序

from xmlrpc.client import ServerProxy
server = ServerProxy("http://10.114.38.22:7777")
# 或者下载列表
# !pip install lxml bs4 -i https://pypi.tuna.tsinghua.edu.cn/simple
def get_http_list(url="http://10.114.38.22:8888"):
    import requests
    from bs4 import BeautifulSoup
    soup=BeautifulSoup(requests.get(url).text, "lxml") # soup.prettify()
    # soup.find_all('div', class_='cangtoushi-item')
    print(soup.text.strip())
get_http_list("http://10.114.38.22:8888/data")
Directory listing for /data/ Directory listing for /data/ cbow.title skipgram.title toutiao.txt