codes = new Vector<String>();
titles = new Vector<String>();
urls = new Vector<String>();
lecturers = new Vector<String>();
while (m.find()) {
String courseCode = m.group(1);
String courseTitle = m.group(2);
String courseURL = url;
String lecturerName = m.group(4);
codes.add(courseCode);
titles.add(courseTitle);
urls.add(courseURL);
lecturers.add(lecturerName);
}
I'm trying to get data from like 10 websites and it works alright if you just print out each group by itself eg: system.out.println(courseCode); prints out a list of 10 courseCodes but when I try to add them into these vectors it only adds the last courseCode instead of each one. So each vector SHOULD have like 10 elements but they only have 1. Is there a way to like iterate through the matches?