Re: How can I extract cell data (content surrounded by ) from a in HTML response?

Wed, 18 Nov 2009 08:49:20 -0800

On 18/11/2009, rosiere <[email protected]> wrote:
>
>  Hello,
>
>  I found that JMeter's oro regex is somehow different from java's.

Yes.

But not all that different; and neither is particularly well suited to
this task.

The XPath Extractor will probably be much easier to use.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#XPath_Extractor

This was discussed on the mailing list earlier this year.

>  Now I need to iterate on different <tr> that matches a pattern, then:
>   capture all the <td> elements within each <tr> , and select the 8th and 9th
>  <td>.
>
>  Since many <tr> elements appears in the HTML response, in order to do this I
>  have to capture <tr> line by line without including two lines in a same
>  group:
>
>  so I should avoid capturing  continuous <tr>..</tr><tr>..</tr> into the same
>  group.
>
>  By writing (?is)<tr\sclass="tgDataLine.*1\)\" >(.*)</tr> I will capture only
>  one group that contains many real <tr> elements.
>
>  So what should I write in the regex?
>
>  Thanks.
>
>
>
>
>  rosiere wrote:
>  >
>  > Thanks,
>  >
>  > In fact I'm facing difficulty with regular expressions and their
>  > application in JMeter.
>  >
>  > I would like to capture the 8th and 9th columns (TD) from this HTML:
>  > what expression should I write?
>  >
>  >
>  > <TR class="tgDataLine1" onMouseOver="setOverColor(this, 'tgDataLine1',
>  > 'loginForm', true,'tabGenCheckBox_EXTRANET_DEMANDE_ID',1)"
>  > onMouseOut="setOverColor(this, 'tgDataLine1', 'loginForm',
>  > false,'tabGenCheckBox_EXTRANET_DEMANDE_ID',1)" ><TD class="tgDataColumn"
>  > style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">14/11/2009</TD>
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">R0219970&nbsp;</TD>
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">LECLERC
>  > ET VILLEDIEU</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">345160774</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">PHOTOCOPIEUR</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">13600.00</TD>
>  >
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">60</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">T</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">ACCORD</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">13/11/2009</TD>
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0&amp;alternativeForward=recapitulatifDemandeDocument'">
>  > images/unNonLu.gif </TD>
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">
>  > images/cb_ko.JPG </TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">Location</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=0'">MME
>  > LEROUX FABIENNE</TD>
>  > </TR>
>  > <TR class="tgDataLine2" onMouseOver="setOverColor(this, 'tgDataLine2',
>  > 'loginForm', true,'tabGenCheckBox_EXTRANET_DEMANDE_ID',2)"
>  > onMouseOut="setOverColor(this, 'tgDataLine2', 'loginForm',
>  > false,'tabGenCheckBox_EXTRANET_DEMANDE_ID',2)" ><TD class="tgDataColumn"
>  > style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">14/11/2009</TD>
>  >
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">R0219945&nbsp;</TD>
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">AGROSTAR</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">313609133</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">PHOTOCOPIEUR</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">20000.00</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">54</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">T</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">ACCORD</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">13/11/2009</TD>
>  >
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1&amp;alternativeForward=recapitulatifDemandeDocument'">
>  > images/unNonLu.gif </TD>
>  > <TD class=tgDataColumn NoWrap  align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">
>  > images/cb_ko.JPG </TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'">Location</TD>
>  > <TD class="tgDataColumn" style="white-space: nowrap;" align="center"
>  > 
> onClick="document.location='/ExtranetEuro/navigation.do?useSession=true&amp;index=1'"></TD>
>  > </TR>
>  >
>  >
>  >
>  >
>  >
>  >
>  > rosiere wrote:
>  >>
>  >> Hello,
>  >>
>  >> I need to use JMeter to extract somes specifics lines (say, a line that
>  >> contains: <td>313609133</td>), then , some specific columns' data on
>  >> these line,  (say, the 8th and  9th columns), just like the data
>  >> surrounded by a red line, in attached image:
>  >>
>  >> and at last, store these data into a database.
>  >>
>  >> What iteration controllers and regular expressions should I use to
>  >> extract them, and how can I use them?  and what should I use to store
>  >> these data into a database?
>  >>
>  >> Thanks. http://old.nabble.com/file/p26371440/table.GIF table.GIF
>  >>
>  >>
>  >>
>  >>
>  >>
>  >>
>  >>
>  >
>  >
>
>  --
>
> View this message in context: 
> http://old.nabble.com/How-can-I-extract-cell-data-%28content-surrounded-by-%3Ctd%3E%3C-td%3E%29-from-a-%3Ctable%3E-in-HTML-response--tp26371440p26408429.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [email protected]
>  For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to