6
On a web page, there are one or more tables with information that I need to get in the form of a list.
Specifically, I need to get a list of the values of the 2nd column of a table of the web page I enter. As for example, the pages below.
Link: https://www.iomat.mt.gov.br/do/navegadorhtml/mostrar.htm?id=630236&edi_id=3580
Link: https://www.iomat.mt.gov.br/do/navegadorhtml/mostrar.htm?id=630237&edi_id=3580
Currently, I copy the table to a spreadsheet and then filter the list. But if you had a script (Python, Ruby or Perl) or program (Java or C#) that just informed the link and it already returned the list would be a hand in the wheel.
The page with this type of matter always has one of the above patterns.
What language after all? For every language you quoted there will be different tools of web crawling.
– talles
Did you try to make this script? What problem happened while you were trying? What code gave you trouble? What is the question exactly?
– Guilherme Bernal
As I specified in the question, any script or program. Who already has a similar solution based on this question.
– ricidleiv
Open the Chrome console (
Ferramentas > Console Javascript
) and write$x("//tr[position() > 1]/td[2]/p/span/text()")
.– rodrigorgs
Exactly @rodrigorgs. I could post as reply. Thank you for your time.
– ricidleiv
I can’t post as an answer while the question is in abeyance.
– rodrigorgs
How could I rephrase the question to get it approved? I don’t see how I can be any clearer about what I need. I posted in the question the solution that I use (even if rough, I know), but wanted something more robust.
– ricidleiv
@ricidleiv, I thought your question was well formulated. You made it clear that any solution (with any language) is useful to you.
– José Filipe Lyra
I believe that to improve the question you should leave it more "generic", so it can be useful for a larger number of developers. For example in the title: "How to get values from a column of multiple tables displayed on a web page?" So within the question, you might even be a little more specific. This way, you open the range of your question and continue with your problem solved.
– Bruno Gasparotto
The @Brunogasparotto suggestion is great! So everyone wins
– José Filipe Lyra
Thank you @Brunogasparotto, I accepted your suggestion of the title and tried to reformulate the introduction of the question.
– ricidleiv