TypeError: Type str doesn't support the buffer API # find method?

前端 未结 2 1687
误落风尘
误落风尘 2021-01-12 02:36

Here is my input:


..........

      
      
2条回答
  •  萌比男神i
    2021-01-12 03:02

    You can also make the data coming from your input a str object, like this:

    url = "http://www.google.com"
    req = request.Request(url)
    response = request.urlopen(req)
    page = str(response.read()) # make it a str object
    print(page[page.find('id='):]) # now you don't need a b in front of your string
    

提交回复
热议问题