Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74908 > unrolled thread
| Started by | Nicholas Cannon <nicholascannon1@gmail.com> |
|---|---|
| First post | 2014-07-21 00:20 -0700 |
| Last post | 2014-07-21 02:13 -0700 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.lang.python
Html Parsing stuff Nicholas Cannon <nicholascannon1@gmail.com> - 2014-07-21 00:20 -0700
Re: Html Parsing stuff Nicholas Cannon <nicholascannon1@gmail.com> - 2014-07-21 02:13 -0700
| From | Nicholas Cannon <nicholascannon1@gmail.com> |
|---|---|
| Date | 2014-07-21 00:20 -0700 |
| Subject | Html Parsing stuff |
| Message-ID | <b0caa90b-bf6b-4d3c-b6ff-43246e006b70@googlegroups.com> |
Ok i get the basics of this and i have been doing some successful parsings and using regular expressions to find html tags. I have tried to find an img tag and write that image to a file. I have had no success. It says it has successfully wrote the image to the file with a try... except statement but when i try to open this it says that the image has like no been saved correctly or is damaged. This was just reading the src attribute of the tag and trying to save that link to a .jpg(the extension of the image). Ok so i looked deeper and added a forward slash to the url and then added the image src attribute to it. I then opened that link with the urllib.urlopen() and then read the contents and saved it to the file again. I still got the same result as before. Is there a function in beautiful soup or the urllib module that i can use to save and image. This is just a problem i am sorting out not a whole application so the code is small. Thanks
[toc] | [next] | [standalone]
| From | Nicholas Cannon <nicholascannon1@gmail.com> |
|---|---|
| Date | 2014-07-21 02:13 -0700 |
| Message-ID | <e6955a94-10ca-4cc3-bf8e-c35161196b01@googlegroups.com> |
| In reply to | #74908 |
dont worry it has been solved
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web