从网站保存嵌入式pdf [英] Save embedded pdf from website

查看:157
本文介绍了从网站保存嵌入式pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



目前我手动搜索化学品并保存pdf并在我的程序中添加一个pdf链接。问题是我还有很多化学药品要去,所以最好自动化这个过程。例如:一种化学药品有以下部件号:271004

>

包含pdf的链接位于此处:














我一直在阅读页面源代码,但无法找到pdf的链接。



但是我对html / javascript的知识目前是有限的......

p>

有没有办法从网站中提取pdf?



感谢任何建议:) p>

解决方案

在页面中查找iframe元素ID msdsPageFrame 。该元素的 src 属性包含PDF的url。下载该网址。



如果您有关于如何下载网址或如何解析网页以搜索ID的问题,请提出另一个问题。


I am writing a small C# application to manage our Safety data Sheets (of chemicals) from our suppliers.

At the moment I manually search for the chemical and save the pdf and add a link to the pdf in my program. The problem is I still have many chemical to go so it would be better to automate the process.

For example: A chemical has the following part number: 271004

The link containing the pdf is here:

Link

I have been reading the page source but cannot find a link to the pdf

But my knowledge of html/javascript is to limited at the moment.....

Is there any way to extract the pdf from the website?

Thanks in advance for any advice :)

解决方案

Look in the page for an iframe element with id "msdsPageFrame". The src attribute of that element contains the url to your PDF. Download that url.

If you have questions about how to download an URL or how to parse a page in search for an id, ask another question.

这篇关于从网站保存嵌入式pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆