Welcome to mirror list, hosted at ThFree Co, Russian Federation.

query_examples.txt « examples - github.com/hxseven/htmlSQL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 638bd6cc841ecea138b5b8691ce5c70d0eff9242 (plain)
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
41
42
43
44
45
46
47
48
49
50
51

Some query examples for copy & paste ;-)


SELECT * FROM h1
^ select all <h1> tags


SELECT * FROM a
^ select all links


SELECT * FROM td
^ select all <td>'s


SELECT href as url, text FROM a
^ return href as url and text as text from all links


SELECT * FROM a WHERE preg_match("/^http:\/\//", $href)
^ find all external links


SELECT * FROM a WHERE preg_match("/^\/snippets/i", $href) and preg_match("/^array_/i", $text)
^ find all links starting with /snippets and with a link text starting with "array_"


SELECT * FROM *
^ select all attributes of all tags ;-)


SELECT id, name, password FROM user WHERE $status == "active"
^ select all <user> tags where status="active" (for XML files)


SELECT * FROM * WHERE $id == "header"
^ return all tags with the $id = header


SELECT * FROM a WHERE substr($href,0,1) != "/"
^ select links with URLs that start with / (mainly internal links)


SELECT * FROM * WHERE $class == "nav_item"
^ select all tags with the class = nav_item


SELECT * FROM a WHERE ($href == "foo.htm" and $title == "foo") or ($title == "bar")
^ complex query