HEADING [CENTER]/FOOTING [CENTER/BOTTOM]关键词:

页标题  SUBHEAD HEADING  [CENTER]

页脚注  FOOTING  [CENTER/BOTTOM]

 

 

结果:

 

PAGE 1
CAR FILE START
COUNTRY CAR MODEL SEATS
ENGLAND JAGUAR V12XKE AUTO 2
JAGUAR XJ12L AUTO 5
JENSEN INTERCEPTOR III 4
TRIUMPH TR7 2
FRANCE PEUGEOT 504 4 DOOR 5
ITALY ALFA ROMEO 2000 4 DOOR BERLINA 4
ALFA ROMEO 2000 GT VELOCE 2
ALFA ROMEO 2000 SPIDER VELOCE 2
MASERATI DORA 2 DOOR 2
JAPAN DATSUN B210 2 DOOR AUTO 4
TOYOTA COROLLA 4 DOOR DIX AUTO 4
W GERMANY AUDI 100 LS 2 DOOR AUTO 5
BMW 2002 2 DOOR 5
BMW 2002 2 DOOR AUTO 4
BMW 3.0 SI 4 DOOR 5
BMW 3.0 SI 4 DOOR AUTO 5
BMW 530I 4 DOOR 5
BMW 530I 4 DOOR AUTO 5
CAR FILE END
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
很高兴为您提供帮助,以下是我提供的爬虫脚本: ```python import requests from bs4 import BeautifulSoup import openpyxl from docx import Document # 输入检索关键词和已有Excel表的文件名 keyword = input("请输入检索关键词:") excel_file = input("请输入已有Excel表的文件名:") # 读取Excel表格 workbook = openpyxl.load_workbook(excel_file) sheet = workbook.active # 在网站中搜索书名 url = f"http://rbsc.calis.edu.cn:8086/aopac/jsp/indexXyjg.jsp?sw={keyword}&currpage=1" response = requests.get(url) soup = BeautifulSoup(response.text, "html.parser") # 获取搜索结果列表 result_list = soup.find_all("table", {"class": "booklist"}) # 将搜索结果以Excel形式输出 row = 2 for result in result_list: title = result.find("a", {"class": "title"}).text.strip() author = result.find("td", {"class": "author"}).text.strip() publisher = result.find("td", {"class": "publisher"}).text.strip() sheet.cell(row=row, column=1, value=title) sheet.cell(row=row, column=2, value=author) sheet.cell(row=row, column=3, value=publisher) row += 1 workbook.save(excel_file) # 获取书籍分类和馆藏地 classification = soup.find("span", {"class": "marc600a"}).text.strip() location = soup.find("span", {"class": "marc850a"}).text.strip() # 将书籍分类和馆藏地以word形式输出 document = Document() document.add_heading("书籍分类和馆藏地", level=1) document.add_paragraph(f"书籍分类:{classification}") document.add_paragraph(f"馆藏地:{location}") document.save(f"{keyword}.docx") ``` 使用方法: 1. 将以上脚本保存为 Python 文件(例如 `crawler.py`)。 2. 在命令行中运行 `python crawler.py`。 3. 按照提示输入检索关键词和已有 Excel 表的文件名。 4. 程序将在 http://rbsc.calis.edu.cn:8086/aopac/jsp/indexXyjg.jsp 网站中搜索书名,并在 Excel 表格中添加搜索结果。 5. 程序将生成一个 Word 文档,其中包含书籍分类和馆藏地的信息。文档文件名将以检索关键词命名。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值