Archive for the 'Coding' Category
Scraping 101: Extracting Anchor Text with Regexp
• Friday, February 8th, 2008
There are many ways to skin a cat, but when it comes to scraping websites, I like parsing content with regexp. One of the biggest problems I bumped into when parsing HTML is matching opening and closing tags.
Ok let’s try that in English:
(<a [^>]+>) matches <a href=”….”.>.
(.*) *should* match anchor text (I’ll […]
JDBC ClassNotFoundException (NetBeans, Classpath, Java)
• Saturday, June 16th, 2007
If you get a java.lang.ClassNotFoundException error when loading a database driver using the statement:
You can either:
Set CLASSPATH in DOS
Go into DOS (Start/Run/cmd.exe):
For example, if your jar file is at: C:/Program
set CLASSPATH=.;C:/Program Files/java/jdk1.6.0_01/lib/mysql-connector-java-5.0.6-bin.jar
That’s all. But it won’t work if you’re trying to run code in Netbeans.
Set Your Project’s Classpath in Netbeans
If you’re using […]