cob007 19 Posted September 27, 2019 Report Share Posted September 27, 2019 how do i directly scrape table from xpath expression currently it is possible in ubot via scrape table and also exbrowser is using scrape table xbrowser but say im using http post and i am scraping table, then how do i use scrape table command to directly scrape to a table? Quote Link to post Share on other sites
FallingDown 2 Posted September 28, 2019 Report Share Posted September 28, 2019 Think you're out of luck on that one. Scrape to list then add to table. If there's a way other than that I'd also love to know. Sent from my LG-H932 using Tapatalk Quote Link to post Share on other sites
cob007 19 Posted September 28, 2019 Author Report Share Posted September 28, 2019 i think each column of table needs to be scraped to a list? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 28, 2019 Report Share Posted September 28, 2019 Grab the containers (for example the table rows) and then loop through them. Scraping columns can work, but if a cell is empty it will mess up the table structure unless you account for it. Quote Link to post Share on other sites
fastlinks 16 Posted September 28, 2019 Report Share Posted September 28, 2019 xpath to scrape the table https://www.w3schools.com/html/html_tables.asp //div[@class=w3-white w3-padding notranslate w3-padding-16]or use "document text" to get html source, and then regex to get the table value regex(?<=\<table\ id\=\"customers\"\>)(.|\n)*?(?=\<\/table\>) <table id="customers"> <tr> <th>Company</th> <th>Contact</th> <th>Country</th> </tr> <tr> <td>Alfreds Futterkiste</td> <td>Maria Anders</td> <td>Germany</td> </tr> <tr> <td>Centro comercial Moctezuma</td> <td>Francisco Chang</td> <td>Mexico</td> </tr> <tr> <td>Ernst Handel</td> <td>Roland Mendel</td> <td>Austria</td> </tr> <tr> <td>Island Trading</td> <td>Helen Bennett</td> <td>UK</td> </tr> <tr> <td>Laughing Bacchus Winecellars</td> <td>Yoshi Tannamuri</td> <td>Canada</td> </tr> <tr> <td>Magazzini Alimentari Riuniti</td> <td>Giovanni Rovelli</td> <td>Italy</td> </tr> </table> Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.