Parsing HTML via JMeter regexp

前端 未结 3 455
予麋鹿
予麋鹿 2021-01-25 04:46

I have some trouble with a regex in JMeter. I have this form in HTML

3条回答
  •  庸人自扰
    2021-01-25 05:02

    Please don't use regular expressions for getting attribute values. There's so many corner cases in terms of character escaping and such that it's likely to break sometime. Look into XML processing APIs, like SAX, StAX, DOM or XSLT. Do mind that this requires the HTML to be XML compliant (if it's XHTML that's covered).

    Once you get the value of your action attribute via a suitable API, you can then unleash regular expressions on it.

    Alternatively, find out if you can somehow harness what already exists for handling HTTP posts/gets via the Servlet API or something similar. They place URL parameters in a map for retrieval.

提交回复
热议问题