在不打开Web行的情况下启动HTML代码

2024-05-29 09:40:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个可以用HTML代码管理的设备

我想用python将这些HTML代码传递给设备,而不必打开web浏览器,有没有可能的方法?在

import IEC

ie = IEC.IEController()       # Creates a new IE Window   "i want to skip this step"    
ie.Navigate('http://10.16.16.96/set?params=default')       # Navigate to a website. 

Tags: to方法代码importwebnewhtml浏览器
1条回答
网友
1楼 · 发布于 2024-05-29 09:40:12

在python2.x中,使用^{}

import urllib
urlilb.urlopen('http://10.16.16.96/set?params=default').read()

在python3.x中,使用^{}

^{pr2}$

更新

{请不要使用第三方库^如果您不能:

import requests
requests.get('http://10.16.16.96/set?params=default').content

相关问题 更多 >

    热门问题