如何使用此API解析Wikihow?

时间:2015-06-25 09:08:54

标签: php api

我希望能够解析网站wikihow.com,所以经过一些研究后我发现了page。但是我的阅读无视,我不知道该解析网站的人。

例如,当我在网站上制作search时,我有一个带图像的链接列表,可以选择我想要阅读的内容。

所以我尝试用api做同样的事情。我尝试使用这样的查询选项:<form action="usersSave.php" id="formCommercants" method="post"> <table class="table table-hover table-condensed"> <thead> <tr> <th><?php echo "N° Stand"; ?></th> <th><?php echo "Société"; ?></th> <th><?php echo "Rue et numéro"; ?></th> <th><?php echo "NPA et lieu"; ?></th> <th><?php echo "Téléphone fixe"; ?></th> <th><?php echo "Téléphone portable"; ?></th> <th><?php echo "Adresse de courriel"; ?></th> <th><?php echo "Site Internet"; ?></th> <th><?php echo "Domaine d'activité"; ?></th> <th><?php echo "Description"; ?></th> <th><?php echo "Personne de contact"; ?></th> <th><?php echo "Identifiant"; ?></th> <th><?php echo "Emplacement espéré"; ?></th> <th><?php echo "Stand modulable"; ?></th> <th><?php echo "Largeur du stand"; ?></th> <th><?php echo "Longueur du stand"; ?></th> <th><?php echo "Hauteur du stand"; ?></th> <th><?php echo "Surface m2"; ?></th> <th><?php echo "Remarques"; ?></th> <th><?php echo "Nombre prise 220V"; ?></th> <th><?php echo "Nombre prise 380V"; ?></th> <th><?php echo "Table"; ?></th> <th><?php echo "Bandeau"; ?></th> <th><?php echo "Affiches"; ?></th> <th><?php echo "Publicité"; ?></th> <th><?php echo "Personnes inscrites"; ?></th> <th><?php echo "Année"; ?></th> </tr> </thead> <tbody> <?php $mysqli = mysqli_connect($config->host, $config->user, $config->password, $config->db); $query = "SELECT u.id, u.name, u.username, u.email, cb.cb_rue, cb.cb_lieu, cb.cb_tlphonefixe, cb.cb_tlphoneportable, cb.cb_website, cb.cb_domaine, cb.cb_description, cb.cb_contact, cb.cb_emplacementespr, cb.cb_standmodulable, cb.cb_largeurstand, cb.cb_longueurstand, cb.cb_hauteurstand, cb.cb_remarques, cb.cb_prise220v, cb.cb_prise380v, cb.cb_table, cb.cb_bandeau, cb.cb_affiches, cb.cb_publicite, cb.cb_personnesinscrites, cb.cb_annee, cb.cb_no_stand, cb.cb_surface_m2 FROM expo_users u INNER JOIN expo_comprofiler cb ON u.id = cb.user_id INNER JOIN expo_user_usergroup_map uum ON u.id = uum.user_id WHERE uum.group_id = 2 and cb.cb_annee = ". $year ." ORDER BY u.name"; $res = mysqli_query($mysqli, $query); while($row = mysqli_fetch_object($res)){ ?> <tr> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_no_stand]" class="input-medium" value="<?php echo $row->cb_no_stand; ?>" required/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][name]" class="input-medium" value="<?php echo $row->name; ?>" required/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_rue]" class="input-medium" value="<?php echo $row->cb_rue; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_lieu]" class="input-medium" value="<?php echo $row->cb_lieu; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_tlphonefixe]" class="input-medium" value="<?php echo $row->cb_tlphonefixe; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_tlphoneportable]" class="input-medium" value="<?php echo $row->cb_tlphoneportable; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][email]" class="input-medium" value="<?php echo $row->email; ?>" required/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_website]" class="input-medium" value="<?php echo $row->cb_website; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_domaine]" class="input-medium" value="<?php echo $row->cb_domaine; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_description]" class="input-medium" value="<?php echo $row->cb_description; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_contact]" class="input-medium" value="<?php echo $row->cb_contact; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][username]" class="input-medium" value="<?php echo $row->username; ?>" required/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_emplacementespr]" class="input-medium" value="<?php echo $row->cb_emplacementespr; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_standmodulable]" class="input-medium" value="<?php echo $row->cb_standmodulable; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_largeurstand]" class="input-medium" value="<?php echo $row->cb_largeurstand; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_longueurstand]" class="input-medium" value="<?php echo $row->cb_longueurstand; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_hauteurstand]" class="input-medium" value="<?php echo $row->cb_hauteurstand; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_surface_m2]" class="input-medium" value="<?php echo $row->cb_surface_m2; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_remarques]" class="input-medium" value="<?php echo $row->cb_remarques; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_prise220v]" class="input-medium" value="<?php echo $row->cb_prise220v; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_prise380v]" class="input-medium" value="<?php echo $row->cb_prise380v; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_table]" class="input-medium" value="<?php echo $row->cb_table; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_bandeau]" class="input-medium" value="<?php echo $row->cb_bandeau; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_affiches]" class="input-medium" value="<?php echo $row->cb_affiches; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_publicite]" class="input-medium" value="<?php echo $row->cb_publicite; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_personnesinscrites]" class="input-medium" value="<?php echo $row->cb_personnesinscrites; ?>"/> </td> <td><input type="text" name="user[<?php echo $row->id; ?>][cb_annee]" class="input-medium" disabled value="<?php echo $row->cb_annee; ?>"/> </td> </tr> <?php } ?> </tbody> </table> </form> 。什么也没来。它真的是该网站的API。你有一个如何使用api的例子。

1 个答案:

答案 0 :(得分:0)

是的,wikiHow的API与MediaWiki的API相同。但它不提供像http://www.wikihow.com/api.php?action=query&titles=fries

这样的API