こちらが歌詞サイトへのリンクのページです
通常の方法を使用すると、歌詞ではなく「 http://lyricsvip.com 」だけが表示されます。
こちらが歌詞サイトへのリンクのページです
通常の方法を使用すると、歌詞ではなく「 http://lyricsvip.com 」だけが表示されます。
これは、歌詞が Javascript によって読み込まれ、ページをスクレイピングしようとすると「通常の」方法では Javascript が実行されないためです。
残念ながら、ソースで見つかった Javascript メソッドを実行できない限り、運が悪いようです。
<body onload="javascript:getContent('aerosmith', 'crazy', '1281384888', '0475352e376cf1c3906afd8ec1b8ac70')">
おそらくそれを防ぐためにそこに置かれているので、あなたができないと確信しています.. :)
If you really want to do this, it is possible. You will need to control something like Gecko (using e.g. pywebkigtk) to open the web page up in a full browser that can execute JS, and then get the source code from that once it's finished rendering.
However, you won't be able to do it with any less than that. If you look at the Javascript source, you'll see that it just makes an AJAX POST request to content.php
:
var url = "content.php?artist=" + artist + "&title=" + title + "&time=" + time + "&check=" + check;
with check
, probably a hashed session ID. This is undoubtedly there to stop people doing exactly what you are doing.
Windows を使用している場合は、PAMIEを使用してブラウザーを駆動できます。