org.encog.bot
public final class BotUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE
How much data to read at once.
|
Modifier and Type | Method and Description |
---|---|
static void |
downloadPage(URL url,
File file)
Load the specified URL to a file.
|
static String |
extract(String str,
String token1,
String token2,
int index)
This method is very useful for grabbing information from a HTML page.
|
static String |
extractFromIndex(String str,
String token1,
String token2,
int index,
int occurence)
This method is very useful for grabbing information from a HTML page.
|
static int |
findOccurance(String search,
String searchFor,
int index)
Find the specified occurrence of one string in another string.
|
static String |
loadPage(InputStream is)
Load load from the specified input stream.
|
static String |
loadPage(URL url)
Load the specified web page into a string.
|
static String |
stripTags(String str)
Strip any HTML or XML tags from the specified string.
|
public static final int BUFFER_SIZE
public static void downloadPage(URL url, File file)
url
- The URL.file
- The file.public static String extract(String str, String token1, String token2, int index)
str
- The string to search.token1
- The text, or tag, that comes before the desired texttoken2
- The text, or tag, that comes after the desired textindex
- Which occurrence of token1 to use, 1 for the firstpublic static String extractFromIndex(String str, String token1, String token2, int index, int occurence)
str
- The string to search.token1
- The text, or tag, that comes before the desired texttoken2
- The text, or tag, that comes after the desired textindex
- Index in the string to start searching from.occurence
- What occurrence.public static int findOccurance(String search, String searchFor, int index)
search
- The string to search.searchFor
- What we are searching for.index
- The occurrence to find.public static String loadPage(InputStream is)
is
- The input stream to load from.public static String loadPage(URL url)
url
- The url to load.Copyright © 2014. All Rights Reserved.