単一のメソッドで複数の配列文字列を返す方法を提案してください:
public ArrayList<String> scraptable() throws InterruptedException {
pui = new Polled(driver);
ArrayList<String> firstname = new ArrayList<String>();
ArrayList<String> lastname = new ArrayList<String>();
ArrayList<String> email = new ArrayList<String>();
WebElement usertable = pui.tbl_userlist;
List<WebElement> allRows = usertable.findElements(By.tagName("tr"));
for (int row = 1; row < allRows.size(); row++) {
String Firstname = driver.findElement(
By.xpath("//*[@id='tbUserList']/tbody/tr[" + row
+ "]/td[2]")).getText();
firstname.add(Firstname);
String Lastname = driver.findElement(
By.xpath("//*[@id='tbUserList']/tbody/tr[" + row
+ "]/td[3]")).getText();
lastname.add(Lastname);
String Email = driver.findElement(
By.xpath("//*[@id='tbUserList']/tbody/tr[" + row
+ "]/td[4]")).getText();
email.add(Email);
}
return null;
firstname
、、lastname
および配列文字列を返す必要がありemail
ます。複数の配列文字列を返すにはどうすればよいですか?