Code:
#!/usr/bin/env python
import os, sys
file = open("find.html")
myString = file.read()
mySubString=myString[myString.find("Results"):myString.find("title")]
print mySubString
I'm probably doing this a backwards way, but I'm trying to find a specific set of characters from a html document, everything between the words "Results" and the first occurrence of "title". However it keeps coming back blank.
It seems to start at "Results" fine, and depending on if i change the word title to some other set of characters that can be found in the html file, it will work.
Also, this code seems to pick up everything all the way to the last occurrence. How do i limit it to just the first time?
Thanks