import pywikibot as pw
import re as re
site = pw.Site('fr', 'wikipedia')
regex = '\| superficie  = [0-9]+.[0-9]+'
count = 0
#print (pw.site.APISite.allpages())
print(pw.Category(site, 'Catégorie:Portail:Luxembourg/Articles_liés'))

member = pw.Category(site, 'Catégorie:Portail:Luxembourg/Articles_liés').members(namespaces = [0])
for page in member:
    #print (page)    
    old_text = page.text
    #print (page.title())
    #print (pw.textlib.extract_templates_and_params_regex_simple( old_text))
    match = re.search(r'\| superficie  = [0-9]+.[0-9]+', old_text)
    if match:
        textRemove = match.group()
        print (textRemove)        
        new_text = old_text.replace(textRemove, '')
        new_text = new_text.replace('\n\n', '\n',1)
        #print (new_text)
        page.text = new_text
        page.save(u"Wikipédia:Bot/Requêtes/2018/05-Rbot:champs superficie inutile dans infobox")
        count = count + 1
        print (count)
        #extract pages templates
        #template = pw.textlib.extract_templates_and_params_regex_simple( old_text)
        #print (template)
[[fr:Catégorie:Portail:Luxembourg/Articles liés]]
| superficie  = 13.74
Page [[fr:Beaufort (Luxembourg)]] saved
1
| superficie  = 23.31
Sleeping for 8.9 seconds, 2018-06-01 13:37:38
Page [[fr:Bech (Luxembourg)]] saved
2
| superficie  = 28.41
Sleeping for 8.6 seconds, 2018-06-01 13:37:49
Page [[fr:Beckerich]] saved
3
| superficie  = 21.93
Sleeping for 6.6 seconds, 2018-06-01 13:38:01
Page [[fr:Berdorf]] saved
4
| superficie  = 17.39
Sleeping for 7.5 seconds, 2018-06-01 13:38:10
Page [[fr:Bertrange (Luxembourg)]] saved
5
| superficie  = 21.45
Sleeping for 8.2 seconds, 2018-06-01 13:38:19
Page [[fr:Bettembourg]] saved
6
| superficie  = 23.24
Sleeping for 8.9 seconds, 2018-06-01 13:38:28
Page [[fr:Bettendorf (Luxembourg)]] saved
7
| superficie  = 26.08
Sleeping for 8.6 seconds, 2018-06-01 13:38:39
Page [[fr:Betzdorf (Luxembourg)]] saved
8
| superficie  = 20.75
Sleeping for 7.3 seconds, 2018-06-01 13:38:50
Page [[fr:Bissen]] saved
9
| superficie  = 23.08
Sleeping for 8.6 seconds, 2018-06-01 13:38:59
Page [[fr:Biwer]] saved
10
| superficie  = 32.13
Sleeping for 6.1 seconds, 2018-06-01 13:39:11
Page [[fr:Boulaide]] saved
11
| superficie  = 36.86
Sleeping for 8.5 seconds, 2018-06-01 13:39:19
Page [[fr:Bourscheid (Luxembourg)]] saved
12
| superficie  = 15.43
Sleeping for 8.7 seconds, 2018-06-01 13:39:29
Page [[fr:Bous (Luxembourg)]] saved
13
| superficie  = 85.61
Page [[fr:Clervaux]] saved
14
| superficie  = 12.31
Sleeping for 7.2 seconds, 2018-06-01 13:40:07
Page [[fr:Colmar-Berg]] saved
15
| superficie  = 25.72
Sleeping for 6.6 seconds, 2018-06-01 13:40:17
Page [[fr:Consdorf]] saved
16
| superficie  = 20.55
Sleeping for 7.8 seconds, 2018-06-01 13:40:26
Page [[fr:Contern]] saved
17
| superficie  = 18.98
Sleeping for 4.9 seconds, 2018-06-01 13:40:39
Page [[fr:Dalheim (Luxembourg)]] saved
18
| superficie  = 17.42
Sleeping for 4.1 seconds, 2018-06-01 13:40:50
Page [[fr:Dippach]] saved
19
| superficie  = 21.55
Page [[fr:Ell (Luxembourg)]] saved
20
| superficie  = 17.97
Sleeping for 4.0 seconds, 2018-06-01 13:41:10
Page [[fr:Erpeldange-sur-Sûre]] saved
21
| superficie  = 51.25
Sleeping for 8.2 seconds, 2018-06-01 13:41:16
Page [[fr:Esch-sur-Sûre]] saved
22
| superficie  = 22.76
Page [[fr:Feulen]] saved
23
| superficie  = 19.61
Sleeping for 8.1 seconds, 2018-06-01 13:41:36
Page [[fr:Fischbach (Mersch)]] saved
24
| superficie  = 30.17
Sleeping for 8.5 seconds, 2018-06-01 13:41:45
Page [[fr:Flaxweiler]] saved
25
| superficie  = 18.43
Sleeping for 3.6 seconds, 2018-06-01 13:42:00
Page [[fr:Frisange]] saved
26
| superficie  = 29.41
Sleeping for 4.1 seconds, 2018-06-01 13:42:10
Page [[fr:Goesdorf]] saved
27
| superficie  = 20.11
Page [[fr:Grosbous]] saved
28
| superficie  = 13.34
Sleeping for 4.9 seconds, 2018-06-01 13:42:29
Page [[fr:Heffingen]] saved
29
| superficie  = 27.22
Sleeping for 6.1 seconds, 2018-06-01 13:42:38
Page [[fr:Hesperange]] saved
30
| superficie  = 55.38
Page [[fr:Junglinster]] saved
31
| superficie  = 14.86
Sleeping for 7.7 seconds, 2018-06-01 13:42:57
Page [[fr:Kayl]] saved
32
| superficie  = 28.18
Sleeping for 8.4 seconds, 2018-06-01 13:43:06
Page [[fr:Kehlen]] saved
33
| superficie  = 33.58
Sleeping for 8.0 seconds, 2018-06-01 13:43:17
Page [[fr:Kiischpelt]] saved
34
| superficie  = 18.88
Sleeping for 6.6 seconds, 2018-06-01 13:43:28
Page [[fr:Koerich]] saved
35
| superficie  = 7.98
Sleeping for 8.2 seconds, 2018-06-01 13:43:36
Page [[fr:Kopstal]] saved
36
| superficie  = 48.50
Sleeping for 6.7 seconds, 2018-06-01 13:43:48
Page [[fr:Lac de la Haute-Sûre (commune)]] saved
37
| superficie  = 15.40
Sleeping for 7.5 seconds, 2018-06-01 13:43:57
Page [[fr:Larochette]] saved
38
| superficie  = 20.35
Sleeping for 8.2 seconds, 2018-06-01 13:44:06
Page [[fr:Lenningen (Luxembourg)]] saved
39
| superficie  = 13.57
Sleeping for 7.4 seconds, 2018-06-01 13:44:17
Page [[fr:Leudelange]] saved
40
| superficie  = 15.25
Sleeping for 5.4 seconds, 2018-06-01 13:44:29
Page [[fr:Lintgen]] saved
41
| superficie  = 17.45
Page [[fr:Lorentzweiler]] saved
42
| superficie  = 27.54
Page [[fr:Mamer]] saved
43
| superficie  = 27.68
Sleeping for 8.4 seconds, 2018-06-01 13:44:59
Page [[fr:Manternach]] saved
44
| superficie  = 49.74
Sleeping for 3.8 seconds, 2018-06-01 13:45:13
Page [[fr:Mersch]] saved
45
| superficie  = 15.25
Sleeping for 8.4 seconds, 2018-06-01 13:45:19
Page [[fr:Mertert]] saved
46
| superficie  = 11.10
Sleeping for 8.9 seconds, 2018-06-01 13:45:28
Page [[fr:Mertzig]] saved
47
| superficie  = 21.40
Sleeping for 6.0 seconds, 2018-06-01 13:45:41
Page [[fr:Mondercange]] saved
48
| superficie  = 13.66
Sleeping for 8.8 seconds, 2018-06-01 13:45:48
Page [[fr:Mondorf-les-Bains]] saved
49
| superficie  = 41.36
Sleeping for 3.0 seconds, 2018-06-01 13:46:04
Page [[fr:Niederanven]] saved
50
| superficie  = 22.44
Sleeping for 7.6 seconds, 2018-06-01 13:46:10
Page [[fr:Nommern]] saved
51
| superficie  = 70.64
Sleeping for 4.7 seconds, 2018-06-01 13:46:22
Page [[fr:Parc Hosingen]] saved
52
| superficie  = 11.93
Sleeping for 5.6 seconds, 2018-06-01 13:46:32
Page [[fr:Pétange]] saved
53
| superficie  = 15.60
Sleeping for 3.4 seconds, 2018-06-01 13:46:44
Page [[fr:Préizerdaul]] saved
54
| superficie  = 27.13
Sleeping for 6.9 seconds, 2018-06-01 13:46:50
Page [[fr:Putscheid]] saved
55
| superficie  = 79.09
Sleeping for 7.4 seconds, 2018-06-01 13:47:00
Page [[fr:Rambrouch]] saved
56
| superficie  = 20.42
Sleeping for 8.3 seconds, 2018-06-01 13:47:09
Page [[fr:Reckange-sur-Mess]] saved
57
| superficie  = 31.95
Sleeping for 8.7 seconds, 2018-06-01 13:47:19
Page [[fr:Redange]] saved
58
| superficie  = 14.84
Sleeping for 7.3 seconds, 2018-06-01 13:47:30
Page [[fr:Reisdorf]] saved
59
| superficie  = 23.79
Sleeping for 6.1 seconds, 2018-06-01 13:47:41
Page [[fr:Roeser]] saved
60
| superficie  = 57.07
Sleeping for 7.7 seconds, 2018-06-01 13:47:50
Page [[fr:Rosport-Mompach]] saved
61
| superficie  = 14.86
Page [[fr:Saeul]] saved
62
| superficie  = 7.73
Sleeping for 8.4 seconds, 2018-06-01 13:48:09
Page [[fr:Sandweiler]] saved
63
| superficie  = 24.42
Sleeping for 8.7 seconds, 2018-06-01 13:48:19
Page [[fr:Sanem]] saved
64
| superficie  = 31.42
Sleeping for 7.7 seconds, 2018-06-01 13:48:30
Page [[fr:Schengen]] saved
65
| superficie  = 10.41
Sleeping for 8.7 seconds, 2018-06-01 13:48:39
Page [[fr:Schieren (Luxembourg)]] saved
66
| superficie  = 7.71
Sleeping for 8.9 seconds, 2018-06-01 13:48:48
Page [[fr:Schifflange]] saved
67
| superficie  = 10.17
Page [[fr:Stadtbredimus]] saved
68
| superficie  = 12.16
Sleeping for 8.5 seconds, 2018-06-01 13:49:09
Page [[fr:Steinfort]] saved
69
| superficie  = 21.81
Sleeping for 8.8 seconds, 2018-06-01 13:49:19
Page [[fr:Steinsel]] saved
70
| superficie  = 10.71
Sleeping for 8.7 seconds, 2018-06-01 13:49:29
Page [[fr:Strassen (Luxembourg)]] saved
71
| superficie  = 63.83
Sleeping for 6.0 seconds, 2018-06-01 13:49:42
Page [[fr:Tandel]] saved
72
| superficie  = 37.86
Page [[fr:Troisvierges]] saved
73
| superficie  = 23.92
Sleeping for 5.6 seconds, 2018-06-01 13:50:02
Page [[fr:Useldange]] saved
74
| superficie  = 12.26
Sleeping for 7.4 seconds, 2018-06-01 13:50:10
Page [[fr:Vichten]] saved
75
| superficie  = 19.74
Sleeping for 7.3 seconds, 2018-06-01 13:50:20
Page [[fr:Wahl]] saved
76
| superficie  = 23.28
Sleeping for 8.8 seconds, 2018-06-01 13:50:29
Page [[fr:Waldbillig]] saved
77
| superficie  = 12.57
Sleeping for 8.8 seconds, 2018-06-01 13:50:39
Page [[fr:Waldbredimus]] saved
78
| superficie  = 7.06
Sleeping for 8.7 seconds, 2018-06-01 13:50:49
Page [[fr:Walferdange]] saved
79
| superficie  = 17.07
Sleeping for 6.9 seconds, 2018-06-01 13:51:01
Page [[fr:Weiler-la-Tour]] saved
80
| superficie  = 113.36
Sleeping for 5.9 seconds, 2018-06-01 13:51:12
Page [[fr:Wincrange]] saved
81
| superficie  = 30.42
Sleeping for 8.9 seconds, 2018-06-01 13:51:19
Page [[fr:Winseler]] saved
82
| superficie  = 17.25
Sleeping for 7.8 seconds, 2018-06-01 13:51:30
Page [[fr:Wormeldange]] saved
83