IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Récuperer le contenu de la balise <title> d'une page distante


Sujet :

Langage PHP

  1. #21
    Expert éminent sénior

    Homme Profil pro
    Développeur Web
    Inscrit en
    Septembre 2010
    Messages
    5 389
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2010
    Messages : 5 389
    Points : 10 422
    Points
    10 422
    Par défaut
    C'est surtout plus court, pour moi c'est pas vraiment plus simple parce que xpath est mystérieux alors que je maitrise assez le dom pour avoir étudié pas mal javascript.

    En tous cas merci pour l'exemple, et double merci pour les liens notamment pour celui en français qui me donne plus envie de m'y intéresser (surtout que ça à l'air bien fait)

  2. #22
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    Tout d'abord merci beaucoup ! Certe je n'y connais rien au xpath et je pense que j aurais pu simplifier très largement mon code mais en tout cas ca fonctionne donc je le poste ça pourrait toujours intéresser quelqu'un.
    Donc $response3 est un array de string et chaque mot est un keyword différent et grace a ca je fais un tableau avec les stats qui m'interesse de la recherche alexa, si vous avez des conseils à me donner je suis prenneur.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    $response4 = array();
    foreach($response3 as $key => $keyword)
    {
     
     
    $keyword=urlencode($keyword);
    $url = "http://www.alexa.com/search?q=$keyword&p=gkey";
     
    libxml_use_internal_errors(true);
     
    $doc = new DOMDocument();
    $doc->loadHTMLFile($url);
     
    libxml_clear_errors();
     
    $xpath = new DOMXPath($doc);
    $items = $xpath->query('//p[@class="qindex"]');
     
    $store = array();
     
     
    foreach($items as $item)
    {
        if(!$item->previousSibling)
        {
            $store[$item->textContent] = array();
            $current = &$store[$item->textContent];
            continue;
        }
     
        $current[] = $item->textContent;
    }
     
    $current2 = array();
     
    $a=0;
    $b=0;
    for($i=0;$i < strlen($current[0]);$i++)
    {
         if(($current[0][$i] >= '0')&&($current[0][$i] <= '9'))
           {
           $current2[0][$a]=$current[0][$i];
           $a++;
           }
    }
    for($i=0;$i < strlen($current[1]);$i++)
    {
     
               if(($current[1][$i] >= '0')&&($current[1][$i] <= '9'))
           {
           $current2[1][$b]=$current[1][$i];
           $b++;
           }
     
    }
    $current2[0]=implode($current2[0]);
    $current2[1]=implode($current2[1]);
     
    $current2[0]=substr($current2[0],4);
    //$current2[1]=substr($current2[0],4);
    $current2[0]=str_replace('100','',$current2[0]);
    $current2[1]=str_replace('100','',$current2[1]);
     
    $current2[0]=(int) $current2[0];
    $current2[1]=(int) $current2[1];
     
     
    $response4[$key][0]=$response3[$key];
    $response4[$key][1]=$current2[0];
    $response4[$key][2]=$current2[1];
    $response4[$key][3]=$current2[1]/$current2[0];
    }

  3. #23
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    ton code rend plein d'erreur, montre ce que t'as en entré et ce que tu voudrais en sortie,

    le 311 de la boucle ça sort d’où ?

    EDIT : t'as aussi changé la requete xpath maintenant elle est fausse, t'as fais du simple copié collé mélangé à de la bidouille sans comprendre le code

  4. #24
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    euh c est la longueur "max" a l arrache que j ai trouver de la chaine je savais pas si un foreach allais fonctionné sur une chaine de caractère sinon j ai pas d erreur moi il fonctionne tres bien (j ai édité 2 truc qui était faux mais c est tout)
    Je lui rentre comme j'ai dis un tableau de keyword et il me renvoi un tableau avec les valeurs associées a ce keyword (cote de popularité et cote de compétition d alexa)

  5. #25
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    travaille en E_ALL | E_STRICT sinon tu va pas t'en sortir,
    montre un exemple concret de ce que tu attends

    et je doute que ton code marche puisque la requete était fausse

  6. #26
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    Je suis en prépa intégré donc forcément un peu brouillon :p je manque d'expérience, bah sur mon environnement de dev j ai fait un var_dump a la fin et j ai bien les résultats que j'attendais.

    en amont j'ai fait un script qui a partir d'un mot clé (google wonder wheel) me renvoi des requetes similaires , après je les classes dans un tableau et j essayes d en sortir des données.

    la requête xpath fonctionne pourtant elle me retourne ce qu il y a entre les balises qindex , ce que je voulais j essayes de faire un peu plus propre au niveau des boucles et je te reposte ca

  7. #27
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    non ta requete est fausse, dis moi pourquoi tu fais un previousSibling alors ?

    voila ce que donne ton code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    $response3 = array('google', 'wonder', 'wheel');
    $response4 = array();
    foreach($response3 as $key => $keyword)
    {
     
     
    $keyword=urlencode($keyword);
    $url = "http://www.alexa.com/search?q=$keyword&p=gkey";
     
    libxml_use_internal_errors(true);
     
    $doc = new DOMDocument();
    $doc->loadHTMLFile($url);
     
    libxml_clear_errors();
     
    $xpath = new DOMXPath($doc);
    $items = $xpath->query('//p[@class="qindex"]');
     
    $store = array();
     
     
    foreach($items as $item)
    {
        if(!$item->previousSibling)
        {
            $store[$item->textContent] = array();
            $current = &$store[$item->textContent];
            continue;
        }
     
        $current[] = $item->textContent;
    }
     
    $current2 = array();
     
    $a=0;
    $b=0;
    for($i=0;$i < 311;$i++)
    {
         if(($current[0][$i] >= '0')&&($current[0][$i] <= '9'))
           {
           $current2[0][$a]=$current[0][$i];
           $a++;
           }
     
               if(($current[1][$i] >= '0')&&($current[1][$i] <= '9'))
           {
           $current2[1][$b]=$current[1][$i];
           $b++;
           }
     
     
     
     
    }
     
    $current2[0]=implode($current2[0]);
    $current2[1]=implode($current2[1]);
    $current2[0]=str_replace('0100','',$current2[0]);
    $current2[1]=str_replace('0100','',$current2[1]);
    $current2[0]=str_replace('100','',$current2[0]);
    $current2[1]=str_replace('100','',$current2[1]);
     
    $current2[0]=(int) $current2[0];
    $current2[1]=(int) $current2[1];
     
     
    $response4[$key][0]=$response3[$key];
    $response4[$key][1]=$current2[0];
    $response4[$key][2]=$current2[1];
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    Notice: Uninitialized string offset: 214 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 215 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 216 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 217 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 218 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 219 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 220 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 221 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 222 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 223 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 224 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 225 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 226 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 227 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 228 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 229 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 230 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 231 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 232 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 233 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 234 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 235 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 236 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 237 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 238 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 239 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 240 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 241 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 242 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 243 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 244 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 245 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 246 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 247 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 248 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 249 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 250 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 251 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 252 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 253 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 254 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 255 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 256 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 257 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 258 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 259 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 260 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 261 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 262 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 263 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 264 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 265 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 266 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 267 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 268 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 269 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 270 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 271 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 272 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 273 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 274 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 275 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 276 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 277 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 278 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 279 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 280 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 281 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 282 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 283 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 284 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 285 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 286 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 287 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 288 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 289 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 290 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 291 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 292 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 293 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 294 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 295 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 296 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 297 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 298 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 299 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 300 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 301 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 301 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 302 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 302 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 303 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 303 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 304 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 304 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 305 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 305 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 306 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 306 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 307 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 307 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 308 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 308 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 309 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 309 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 310 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 310 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 214 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 215 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 216 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 217 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 218 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 219 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 220 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 221 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 222 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 223 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 224 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 225 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 226 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 227 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 228 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 229 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 230 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 231 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 232 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 233 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 234 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 235 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 236 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 237 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 238 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 239 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 240 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 241 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 242 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 243 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 244 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 245 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 246 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 247 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 248 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 249 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 250 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 251 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 252 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 253 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 254 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 255 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 256 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 257 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 258 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 259 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 260 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 261 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 262 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 263 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 264 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 265 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 266 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 267 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 268 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 269 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 270 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 271 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 272 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 273 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 274 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 275 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 276 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 277 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 278 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 279 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 280 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 281 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 282 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 283 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 284 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 285 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 286 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 287 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 288 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 289 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 290 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 291 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 292 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 293 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 294 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 295 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 296 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 297 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 298 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 299 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 300 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 301 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 301 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 302 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 302 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 303 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 303 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 304 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 304 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 305 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 305 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 306 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 306 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 307 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 307 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 308 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 308 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 309 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 309 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 310 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 310 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 214 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 215 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 216 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 217 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 218 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 219 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 220 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 221 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 222 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 223 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 224 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 225 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 226 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 227 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 228 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 229 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 230 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 231 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 232 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 233 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 234 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 235 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 236 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 237 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 238 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 239 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 240 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 241 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 242 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 243 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 244 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 245 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 246 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 247 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 248 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 249 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 250 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 251 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 252 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 253 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 254 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 255 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 256 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 257 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 258 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 259 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 260 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 261 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 262 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 263 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 264 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 265 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 266 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 267 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 268 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 269 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 270 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 271 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 272 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 273 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 274 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 275 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 276 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 277 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 278 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 279 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 280 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 281 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 282 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 283 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 284 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 285 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 286 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 287 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 288 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 289 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 290 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 291 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 292 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 293 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 294 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 295 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 296 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 297 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 298 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 299 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 300 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 301 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 301 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 302 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 302 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 303 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 303 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 304 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 304 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 305 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 305 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 306 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 306 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 307 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 307 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 308 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 308 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 309 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 309 in C:\www\test\index.php on line 49
    
    Notice: Uninitialized string offset: 310 in C:\www\test\index.php on line 43
    
    Notice: Uninitialized string offset: 310 in C:\www\test\index.php on line 49

  8. #28
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    Je sais pas ce que j'ai fait mais ca marche plus .... mon tableau = NULL maintenant :/
    Pour le previousSibling je n'ai pas compris cette partie la en effet donc je l ai gardée

    un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    foreach($items as $item)
    $current[]=$item->textContent;
    suffirait-il ?

    EDIT: En fait j'avais changé le nom d'une variable .... forcement si j affiche une variable qui existe pas ca allais pas fonctionner ...

    donc voilà le var_dump que ca me donne. j'ai aussi fait les boucles plus proprement avec un strlen histoire que ce soit plus cohérent

    bon c'est pas encore fonctionnel mais ca me renvoi pas d erreur comme celle que tu recois toi c est étrange

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    array(68) { [0]=> array(3) { [0]=> string(14) "fauteuil blanc" [1]=> int(4) [2]=> int(9) } [1]=> array(3) { [0]=> string(22) "fauteuil pronunciation" [1]=> int(4) [2]=> int(9) } [2]=> array(3) { [0]=> string(14) "fauteuil chair" [1]=> int(4) [2]=> int(9) } [3]=> array(3) { [0]=> string(15) "fauteuil bureau" [1]=> int(4) [2]=> int(9) } [4]=> array(3) { [0]=> string(7) "bergere" [1]=> int(4) [2]=> int(9) } [5]=> array(3) { [0]=> string(8) "bergère" [1]=> int(4) [2]=> int(9) } [6]=> array(3) { [0]=> string(6) "canape" [1]=> int(4) [2]=> int(9) } [7]=> array(3) { [0]=> string(8) "armchair" [1]=> int(4) [2]=> int(9) } [16]=> array(3) { [0]=> string(19) "fauteuil blanc avec" [1]=> int(4) [2]=> int(9) } [18]=> array(3) { [0]=> string(31) "fauteuil pronunciation armchair" [1]=> int(4) [2]=> int(9) } [21]=> array(3) { [0]=> string(13) "bergere chair" [1]=> int(4) [2]=> int(9) } [22]=> array(3) { [0]=> string(13) "voyeuse chair" [1]=> int(4) [2]=> int(9) } [23]=> array(3) { [0]=> string(16) "ladderback chair" [1]=> int(4) [2]=> int(9) } [24]=> array(3) { [0]=> string(25) "fauteuil chair definition" [1]=> int(4) [2]=> int(9) } [25]=> array(3) { [0]=> string(9) "marquetry" [1]=> int(4) [2]=> int(9) } [26]=> array(3) { [0]=> string(18) "fauteuil furniture" [1]=> int(4) [2]=> int(9) } [27]=> array(3) { [0]=> string(13) "fauteuil seat" [1]=> int(4) [2]=> int(9) } [36]=> array(3) { [0]=> string(15) "fauteuil center" [1]=> int(4) [2]=> int(9) } [37]=> array(3) { [0]=> string(19) "fauteuil department" [1]=> int(4) [2]=> int(9) } [38]=> array(3) { [0]=> string(15) "fauteuil agency" [1]=> int(4) [2]=> int(9) } [39]=> array(3) { [0]=> string(14) "bergere bureau" [1]=> int(4) [2]=> int(9) } [40]=> array(3) { [0]=> string(14) "voyeuse bureau" [1]=> int(4) [2]=> int(9) } [41]=> array(3) { [0]=> string(14) "commode bureau" [1]=> int(4) [2]=> int(9) } [42]=> array(3) { [0]=> string(21) "fauteuil bureau vente" [1]=> int(4) [2]=> int(9) } [50]=> array(3) { [0]=> string(15) "bergere jewelry" [1]=> int(4) [2]=> int(9) } [52]=> array(3) { [0]=> string(27) "reviews hotel royal bergere" [1]=> int(4) [2]=> int(9) } [53]=> array(3) { [0]=> string(11) "bergere hat" [1]=> int(4) [2]=> int(9) } [54]=> array(3) { [0]=> string(21) "antique bergere chair" [1]=> int(4) [2]=> int(9) } [55]=> array(3) { [0]=> string(26) "reproduction bergere chair" [1]=> int(4) [2]=> int(9) } [56]=> array(3) { [0]=> string(25) "bergere chair and ottoman" [1]=> int(4) [2]=> int(9) } [57]=> array(3) { [0]=> string(7) "bartoli" [1]=> int(4) [2]=> int(9) } [66]=> array(3) { [0]=> string(15) "folies bergère" [1]=> int(4) [2]=> int(9) } [67]=> array(3) { [0]=> string(19) "bergère definition" [1]=> int(4) [2]=> int(9) } [68]=> array(3) { [0]=> string(14) "bergère chair" [1]=> int(4) [2]=> int(9) } [69]=> array(3) { [0]=> string(8) "fauteuil" [1]=> int(4) [2]=> int(9) } [70]=> array(3) { [0]=> string(6) "bombé" [1]=> int(4) [2]=> int(9) } [76]=> array(3) { [0]=> string(14) "canape recipes" [1]=> int(4) [2]=> int(9) } [77]=> array(3) { [0]=> string(18) "canape convertible" [1]=> int(4) [2]=> int(9) } [78]=> array(3) { [0]=> string(11) "canape cuir" [1]=> int(4) [2]=> int(9) } [79]=> array(3) { [0]=> string(12) "canape ideas" [1]=> int(4) [2]=> int(9) } [80]=> array(3) { [0]=> string(17) "canape definition" [1]=> int(4) [2]=> int(9) } [81]=> array(3) { [0]=> string(11) "canape food" [1]=> int(4) [2]=> int(9) } [82]=> array(3) { [0]=> string(20) "canape pronunciation" [1]=> int(4) [2]=> int(9) } [83]=> array(3) { [0]=> string(13) "canape vector" [1]=> int(4) [2]=> int(9) } [92]=> array(3) { [0]=> string(18) "armchair furniture" [1]=> int(4) [2]=> int(9) } [93]=> array(3) { [0]=> string(14) "armchair media" [1]=> int(4) [2]=> int(9) } [94]=> array(3) { [0]=> string(16) "armchair general" [1]=> int(4) [2]=> int(9) } [95]=> array(3) { [0]=> string(4) "ikea" [1]=> int(4) [2]=> int(9) } [96]=> array(3) { [0]=> string(5) "chair" [1]=> int(4) [2]=> int(9) } [97]=> array(3) { [0]=> string(10) "club chair" [1]=> int(4) [2]=> int(9) } [98]=> array(3) { [0]=> string(8) "recliner" [1]=> int(4) [2]=> int(9) } [99]=> array(3) { [0]=> string(12) "pottery barn" [1]=> int(4) [2]=> int(9) } [110]=> array(3) { [0]=> string(22) "squared fauteuil blanc" [1]=> int(4) [2]=> int(9) } [113]=> array(3) { [0]=> string(20) "fauteuil blanc choix" [1]=> int(4) [2]=> int(9) } [114]=> array(3) { [0]=> string(20) "fauteuil blanc achat" [1]=> int(4) [2]=> int(9) } [115]=> array(3) { [0]=> string(27) "resistance 2 fauteuil blanc" [1]=> int(4) [2]=> int(9) } [132]=> array(3) { [0]=> string(17) "fauteuil recliner" [1]=> int(4) [2]=> int(9) } [159]=> array(3) { [0]=> string(9) "yamaguchi" [1]=> int(4) [2]=> int(9) } [160]=> array(3) { [0]=> string(5) "faire" [1]=> int(4) [2]=> int(9) } [161]=> array(3) { [0]=> string(14) "singer bartoli" [1]=> int(4) [2]=> int(9) } [162]=> array(3) { [0]=> string(15) "banjo man fleck" [1]=> int(4) [2]=> int(9) } [175]=> array(3) { [0]=> string(15) "bergère folies" [1]=> int(4) [2]=> int(9) } [180]=> array(3) { [0]=> string(6) "canopy" [1]=> int(4) [2]=> int(9) } [181]=> array(3) { [0]=> string(6) "canope" [1]=> int(4) [2]=> int(9) } [182]=> array(3) { [0]=> string(6) "canapy" [1]=> int(4) [2]=> int(9) } [185]=> array(3) { [0]=> string(16) "canape furniture" [1]=> int(4) [2]=> int(9) } [186]=> array(3) { [0]=> string(10) "canape bed" [1]=> int(4) [2]=> int(9) } [187]=> array(3) { [0]=> string(15) "canape software" [1]=> int(4) [2]=> int(9) } } fauteuil blanc49

  9. #29
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    mais dis ce que tu veux au final

  10. #30
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    Prennons un exemple alors:

    prennons le mot clé "fauteuil" mon script en amont me fournit un tableau de keywords

    j'ai donc ("fauteuil blanc", "canape" , "fauteuil design" ) (assez longue liste)

    Ce que je veux c'est établir des statistiques pour chaqu'un de ces mots. Pour cela alexa a un indice très pratique

    prennons "fauteuil blanc"


    " Query Popularity 9 out of 100 - Low"
    "QCI 40 out of 100 - Moderate"

    ce qui m interesse c'est de récupérer ces deux informations sous forme d'int. En gros popularity = 9
    QCI = 40

    alors pour l'instant mon script fonctionne que sur le premier mot (tester avec ("fauteuil blanc" ....) j'ai bien les bonnes valeurs. Mais pour tout les autres ca fonctionnes pas ils ont tous les mêmes valeurs que fauteuil blanc

  11. #31
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    mais a quoi sert tout le blabla la :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    $current2 = array();
     
    $a=0;
    $b=0;
    for($i=0;$i < strlen($current[0]);$i++)
    {
         if(($current[0][$i] >= '0')&&($current[0][$i] <= '9'))
           {
           $current2[0][$a]=$current[0][$i];
           $a++;
           }
    }
    for($i=0;$i < strlen($current[1]);$i++)
    {
     
               if(($current[1][$i] >= '0')&&($current[1][$i] <= '9'))
           {
           $current2[1][$b]=$current[1][$i];
           $b++;
           }
     
    }
    $current2[0]=implode($current2[0]);
    $current2[1]=implode($current2[1]);
     
    $current2[0]=substr($current2[0],4);
    //$current2[1]=substr($current2[0],4);
    $current2[0]=str_replace('100','',$current2[0]);
    $current2[1]=str_replace('100','',$current2[1]);
     
    $current2[0]=(int) $current2[0];
    $current2[1]=(int) $current2[1];
     
     
    $response4[$key][0]=$response3[$key];
    $response4[$key][1]=$current2[0];
    $response4[$key][2]=$current2[1];
    $response4[$key][3]=$current2[1]/$current2[0];

  12. #32
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    bah ce que je récuperes avec la requetes (j ai enlever le truc du milieu que t a fait pour la simplifié)

    ca me retourne "Query Popularity
    An estimate of how frequently users search for fauteuil blanc, on a scale from 0 to 100. Higher numbers indicate higher frequencies. 9 out of 100 - Low"

    Tout ce blabla ca me permet de garder que les chiffres pour extraire d'une phrase un int

    Enfin de compte cela fonctionne comme espéré mais seulement pour le premier keyword pas pour les suivants qui reprennent les valeurs du premier je sais pas pourquoi

  13. #33
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    y'a plus simple,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    $searchs = array('google', 'wonder', 'wheel');
    $store = array();
     
    foreach($searchs as $search)
    {
        $query = http_build_query(array('q' => $search, 'p' => 'qkey'));
        $url = "http://www.alexa.com/search?$query";
     
        libxml_use_internal_errors(true);
     
        $doc = new DOMDocument();
        $doc->loadHTMLFile($url);
     
        libxml_clear_errors();
     
        $xpath = new DOMXPath($doc);
        $items = $xpath->query('//p[@class="qindex"]/text()[last()]');
     
        foreach($items as $item)
        {
            $text = filter_var($item->nodeValue, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
            sscanf($text, '%D', $store[$search][]);
        }
    }
     
    echo '<pre>', print_r($store, true), '<pre>';

  14. #34
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    Bon alors déjà un énorme merci , par contre y a juste un truc qui m'embête y a pas mal de truc que je comprends pas dans ton script. Et aussi j'aime bien savoir ou je me suis planté tu n'aurais pas vu mon erreur par hasard ? (dans mon script)

  15. #35
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    Citation Envoyé par Lomithrani Voir le message
    Bon alors déjà un énorme merci , par contre y a juste un truc qui m'embête y a pas mal de truc que je comprends pas dans ton script. Et aussi j'aime bien savoir ou je me suis planté tu n'aurais pas vu mon erreur par hasard ? (dans mon script)
    tu utilisais mal $current, qui etait juste une référence d'une entré de $store, il fallait donc bouclé sur $store,
    pour la parsage des caractères après ... no comment
    la requete xpath était fausse aussi puisque tu récupérait trop de texte

    pour mon code au delà de xpath,
    filter_var va nettoyer le texte, pusique comme chez Alexa ils ne savent pas coder, ils mettent des &nbsp; (non-breaking space) partout pour les espaces, filter_var va les supprimer grâce a l'option FILTER_FLAG_STRIP_HIGH de FILTER_SANITIZE_STRING
    ensuite sscanf, c'est fait partie de la base de PHP et va de paire avec sprinf et compagnie :
    http://fr.php.net/manual/fr/function.sscanf.php

  16. #36
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 47
    Points : 21
    Points
    21
    Par défaut
    assez magique le xpath quand c est bien utilisé ^^ et bien merci pour tout je pense avoir tout compris dans ton code

  17. #37
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    Citation Envoyé par Lomithrani Voir le message
    assez magique le xpath quand c est bien utilisé ^^ et bien merci pour tout je pense avoir tout compris dans ton code
    oui c'est très puissant (et encore PHP n'est qu'a la version 1 de xpath, la 2 a beaucoup plus de fonction), d'ailleurs ça doit être faisable sans le sscanf et le filter_var

+ Répondre à la discussion
Cette discussion est résolue.
Page 2 sur 2 PremièrePremière 12

Discussions similaires

  1. Réponses: 3
    Dernier message: 20/05/2015, 19h54
  2. Réponses: 1
    Dernier message: 19/05/2015, 21h42
  3. Réponses: 0
    Dernier message: 13/07/2012, 05h04
  4. Récuperation du contenu de la balise
    Par bracket dans le forum Taglibs
    Réponses: 1
    Dernier message: 22/09/2011, 15h28
  5. [CS3] CS3 - balise «strong» et centrage d'une page
    Par Sukotai dans le forum Dreamweaver
    Réponses: 3
    Dernier message: 18/08/2009, 16h41

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo