Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Web Scraping Project Java?
Hi there,
I was wondering if somebody could show me how to get the values from this webpage...
http://www.retrosheet.org/boxesetc/1930/Jwilsh1020...
for HR vs RHP
into my java program
so how can i get just the number 29 and get it into my java program so that i can declare a variable as it. I've been trying to figure this out for days and have got nothing. Any help is appreciated.
Hey, McFate, I really appreciate your time and you are the first person that's been able to give me an answer that makes sense with ample detail. I have no idea how to do any of what you said, but I'm gonna try to learn.
1 Answer
- McFateLv 78 years agoFavorite Answer
Suggestions:
(1) Use HttpURLConnection to create a connection
(2) Use its method getInputStream() to obtain an InputStream; wrap that in an InputStreamReader, and that in a BufferedReader
(3) Use BufferedReader.readLine() to obtain one line at a time.
(4) When you find a line that starts with "vs RHP" then split the line on spaces and take the 8th entity
This all assumes that the layout won't change, and it's assuming the preformatted text that the page currently has (i.e., if they switch to HTML tables dumped out of Excel or something, it won't work any more). I assume that's OK.
@M