-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHttpXPath.hh
40 lines (29 loc) · 878 Bytes
/
HttpXPath.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef HTTPXPATH_HH
#define HTTPXPATH_HH
#include <string>
#include <sstream>
#include <iostream>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <tinyxml.h>
#include "xpath_static.h"
// Use xpath to parse http web pages
class HttpXPath {
public:
// execute an xpath query on the requested page
std::string xPathQuery(std::string xPathQuery);
// perform an http request
void performRequest(std::string url);
// set the http proxy
void setHttpProxy(std::string url, long port);
protected:
// cURLpp::Cleanup is just an utility class that does cURLpp::initialize()
// within the constructor and cURLpp::terminate() within the destructor.
curlpp::Cleanup cleanup;
// request handler
curlpp::Easy request;
// the html page using xml structures
TiXmlDocument doc;
};
#endif // HTTPXPATH_HH