前提・実現したいこと
http://shirayuca.github.io/blog/2014/07/27/recipe.html
上記リンク先の記事を見て、別のレシピサイトであるところのNadia(https://oceans-nadia.com/)でも同じことをやってみたいと思い、質問をさせて頂きました。
以下のようなxmlの中から原材料及びその分量を、醤油大さじ3、酒大さじ2、etc...のように一つずつテキスト形式で取得したいと考えています.
今回、レシピ画像の抽出はせずに、レシピ名と原材料とその分量だけを抽出したいです。
そのようなことを実現できるXpathの指定方法はどのような形になるのでしょうか?
教えていただきたいです.
発生している問題・エラーメッセージ
該当のソースコード
...
...
</div>
<div class="ingredientArea"> <p class="recipeTime"><time datetime="PT15M" itemprop="cookTime">調理時間:15分(漬け込み時間省く)</time></p> <p class="ingredient" itemprop="yield"><span>材料2人分</span></p> </div> <table> <tr class="ingre_group_A" itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient"> <td class="group">A</td> <td class="group_ingredient"><div itemprop="name"><a href="https://oceans-nadia.com/search?q=%E9%86%A4%E6%B2%B9">醤油</a></div></td> <td itemprop="amount" class="group_amount">大さじ3</td> </tr> <tr class="ingre_group_A" itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient"> <td class="group">A</td> <td class="group_ingredient"><div itemprop="name"><a href="https://oceans-nadia.com/search?q=%E9%85%92">酒</a></div></td> <td itemprop="amount" class="group_amount">大さじ2</td> </tr> <tr class="ingre_group_A" itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient"> <td class="group">A</td> <td class="group_ingredient"><div itemprop="name"><a href="https://oceans-nadia.com/search?q=%E6%9C%AC%E3%81%BF%E3%82%8A%E3%82%93">本みりん</a></div></td> <td itemprop="amount" class="group_amount">大さじ1</td> </tr> <tr class="ingre_group_A" itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient"> <td class="group">A</td> <td class="group_ingredient"><div itemprop="name"><a href="https://oceans-nadia.com/search?q=%E3%83%90%E3%83%AB%E3%82%B5%E3%83%9F%E3%82%B3%E9%85%A2">バルサミコ酢</a></div></td> <td itemprop="amount" class="group_amount">小さじ1</td> </tr> <tr class="ingre_group_ " itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient"> <td class="group"> </td> <td class="group_ingredient"><div itemprop="name"><a href="https://oceans-nadia.com/search?q=%E3%83%9E%E3%82%B0%E3%83%AD">マグロ</a></div></td> <td itemprop="amount" class="group_amount">120g</td> </tr> </table>
...
...
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。