简体   繁体   中英

python find a double quoted specific string

I have a block of HTML and I want to do the following.

if html.find('pid":"') != -1:
  # do something

and it always returns -1 . BUT 'pid":' (only one dbl quote works, but finds the wrong tag)

It seems that I was looking at the request.content, but searching on the request.text. And the text I was looking for was eliminated in the request.text version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM