这是我的代码如下-
import scrapy
from scrapy.http import Request
class lyricsFetch(scrapy.Spider):
name = "lyricsFetch"
allowed_domains = ["metrolyrics.com"]
print "\nEnter the name of the ARTIST of the song for which you want the lyrics for. Minimise the spelling mistakes, if possible."
artist_name = raw_input('>')
print "\nNow comes the main part. Enter the NAME of the song itself now. Again, try not to have any spelling mistakes."
song_name = raw_input('>')
artist_name = artist_name.replace(" ", "_")
song_name = song_name.replace(" ","_")
first_letter = artist_name[0]
print artist_name …Run Code Online (Sandbox Code Playgroud)