简体   繁体   中英

How to copy a table using Selenium WebDriver?

I am running test using Selenium (on Java).

  1. I locate a certain webpage
  2. I locate a table (6 by 4)on that webpage
  3. I need to to copy that table to mySQL database.

I know one way: making a for loop and copying elements one by one. Are there any faster and neater ways? Can I refer to the table by its name and somehow copy it ( and NOT loop through each element)?

Nope, you'll have to loop and copy the elements one by one. If the elements have the same names as the MySQL columns, you could potentially save some effort there by reading them from the HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM