Python urllib urlopen not working

后端 未结 8 1158
甜味超标
甜味超标 2021-01-04 07:29

I am just trying to fetch data from a live web by using the urllib module, so I wrote a simple example

Here is my code:

import urllib

sock = urllib         


        
8条回答
  •  时光取名叫无心
    2021-01-04 07:43

    Use this import cv2 import numpy as np import urllib //import urllib using pip import requests // import requests using pipenter code here url = "write your url" while True: imgresp = urllib.request.urlopen(url) imgnp = np.array(bytearray(imgresp.read()),dtype=np.uint8) img = cv2.imdecode(imgnp,-1) cv2.imshow("test",img) cv2.waitKey('q')

提交回复
热议问题