官方版

Search Sequential Pages for Target String

To search for a target string on a series of successively named HTML pages (for example, to find the first page containing “TargetString” from 1.htm, 2.htm, 3.htm, 4.htm, etc.), add rules to Fiddler as follows:

  1. Add a rule to Fiddler with Global scope to create a new menu item as follows:

    1. public static ToolsAction("Find page containing search string")
    2. function doGrab(){
    3. var s = "GET /gallery/image1.htm HTTP/1.1\r\nHost: www.example.com\r\nX-My-Num: 1\r\n\r\n";
    4. try{
    5. FiddlerObject.utilIssueRequest(s);
    6. }
    7. catch(e){
    8. MessageBox.Show("send failed" + e.ToString());
    9. }
    10. }
  2. This will generate the first request. Note: Because the utilIssueRequest call is asynchronous, you don’t get the response directly.

  3. Add a rule to Fiddler in the OnBeforeResponse function as follows:
    1. if (oSession.oRequest.headers.Exists("X-My-Num")){
    2. // This is a response to my Grab code...
    3. if (oSession.utilFindInResponse("targetstring", false) > -1){
    4. // If the index of the target string is >-1, we found the search string...
    5. MessageBox.Show("Found target string!");
    6. }
    7. else
    8. {
    9. //didn't find the target string. increment the number.
    10. var n = int.parse(oSession.oRequest["X-My-Num"]);
    11. n++;
    12. var s = "GET /gallery/image" + n.ToString() + ".htm HTTP/1.1\r\nHost: http://www.example.com\r\nX-My-Num: "+ n.ToString() + "\r\n\r\n";
    13. try{
    14. // Make a recursive HTTP request for the next item.
    15. FiddlerObject.utilIssueRequest(s);
    16. }
    17. catch(e){
    18. MessageBox.Show("send failed" + e.ToString());
    19. }
    20. }
    21. }

谷歌翻译版

在顺序页面中搜索目标字符串

要在一系列连续命名的HTML页面上搜索目标字符串(例如,从1.htm,2.htm,3.htm,4.htm等中查找包含“ TargetString”的第一页),请添加规则 给Fiddler的方法如下:

  1. 将规则添加到具有全局范围的Fiddler来创建一个新菜单项,如下所示:

    1. public static ToolsAction("Find page containing search string")
    2. function doGrab(){
    3. var s = "GET /gallery/image1.htm HTTP/1.1\r\nHost: www.example.com\r\nX-My-Num: 1\r\n\r\n";
    4. try{
    5. FiddlerObject.utilIssueRequest(s);
    6. }
    7. catch(e){
    8. MessageBox.Show("send failed" + e.ToString());
    9. }
    10. }
  2. 这将生成第一个请求。 注意:由于utilIssueRequest调用是异步的,因此您不会直接获得响应。

  3. OnBeforeResponse函数中向Fiddler添加一个规则,如下所示:
    1. if (oSession.oRequest.headers.Exists("X-My-Num")){
    2. // This is a response to my Grab code...
    3. if (oSession.utilFindInResponse("targetstring", false) > -1){
    4. // If the index of the target string is >-1, we found the search string...
    5. MessageBox.Show("Found target string!");
    6. }
    7. else
    8. {
    9. //didn't find the target string. increment the number.
    10. var n = int.parse(oSession.oRequest["X-My-Num"]);
    11. n++;
    12. var s = "GET /gallery/image" + n.ToString() + ".htm HTTP/1.1\r\nHost: http://www.example.com\r\nX-My-Num: "+ n.ToString() + "\r\n\r\n";
    13. try{
    14. // Make a recursive HTTP request for the next item.
    15. FiddlerObject.utilIssueRequest(s);
    16. }
    17. catch(e){
    18. MessageBox.Show("send failed" + e.ToString());
    19. }
    20. }
    21. }