May 6, 2012
I have written code to download a webpage HTML source code into a .txt file, once downloaded, the code I posted here adds all lines as strings into a list and is supposed to find an anchor point as a position reference and then jump down the list to the real keyword.
View 9 Replies
I have an anchor point in this list that is a constant that I will always "know of" but I need to jump down 3 lines below this anchor point to the real keyword I'm looking for that is always "unknown to me" since it's a variable.
My anchor point is the keyword Hair Color which both the words and the line they're on are unique in the entire source code. My target keyword is the variable Brown† (in this case), that I can't target directly because neither it nor the line it's on are unique and will change from query to query. The HTML table source code like the one below is always structured the same but some pages may vary in layout depending on the keywords applicable on the webpage. The code structure below however is always a constant, you can always count on all the webpages that the keyword Hair Color is always the 3 line into the table row and its variable is always 3 lines below that. So even though the answer I'm looking for is always 3 lines below my anchor point, my anchor point will not always be on the same line of code in the source code.
HTML code in the .txt file:
I may not be using the code correctly, through my attempts I don't know how to do that jump.
how to "skip" or "jump" down lines in my list by predefinition like: "ok, I found my anchor point, now I'm supposed to jump down 3 lines and pass what ever I find there to a string!""ok, I found my anchor point, now I'm supposed to go to the second instance of the keyword Brown from here that I find and pass what ever I find there to a string!"