Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #12292
| Path | csiph.com!news.uzoreto.com!feeder.usenetexpress.com!tr1.eu1.usenetexpress.com!81.171.65.16.MISMATCH!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx12.ams4.POSTED!not-for-mail |
|---|---|
| From | Spiros Bousbouras <spibou@gmail.com> |
| Newsgroups | comp.programming |
| Subject | Re: Advice needed on parsing a youtube page |
| Message-ID | <g5YOFtbBG32jNcr7@bongo-ra.co> (permalink) |
| References | <Rafaello@bongo-ra.co> <wNw_H.30423$X63.12490@fx39.iad> <y5A2DjxJJoXPajib@bongo-ra.co> <UXD_H.132743$O68.21782@fx46.iad> |
| In-Reply-To | <UXD_H.132743$O68.21782@fx46.iad> |
| X-Organisation | Weyland-Yutani |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 8bit |
| Lines | 34 |
| X-Complaints-To | http://netreport.virginmedia.com |
| NNTP-Posting-Date | Tue, 02 Mar 2021 17:30:35 UTC |
| Organization | virginmedia.com |
| Date | Tue, 02 Mar 2021 17:30:35 GMT |
| X-Received-Bytes | 2470 |
| Xref | csiph.com comp.programming:12292 |
Show key headers only | View raw
On Sat, 27 Feb 2021 22:18:12 -0500 Richard Damon <Richard@Damon-Family.org> wrote: > On 2/27/21 3:12 PM, Spiros Bousbouras wrote: [...] > > Yes part of the question is how to determine which parts of the page follow > > which grammar. My grammar seems to work correctly for the JSON part of the page > > and that's what I'm interested in. > > > > As Ben said, on an HTML page that was sent out to what it thinks is a > browser, the only place you will find 'active' JSON data is contained in > data inside a script, so withing an area denoted by a <script> element. > > HOW to find that JSON will be a matter of understanding how the page is > built, and what 'JavaScript' code indicates the location of the data you > are looking for. > > Unless you are concerned that some HTML tag is going to have a parameter > that looks like value="<script>", you can probably just ignore all the > stuff outside the script elements, and just parse what is inside them, > as that sounds to be the only stuff you are concerned with (unless you > need to look for something out there to determine which script elements > to process). So one solution to pick out the Javascript part (which I have erroneously been calling JSON) would be to pick out the stuff between <script ....> and </script ...> , yes ? > It should be pointed out that this data you are finding isn't really > JSON itself, but probably some string value in the script with JSON data > inside (so it will need to be parsed as a 'JavaScript' string to get to > the real JSON data. 'Real' JSON isn't embedded in an HTML page, but is > typically sent as a response on its own, and in that case, it doesn't > need to first be parsed as a 'string' to get to the JSON data.
Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread
Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-02-27 14:43 +0000
Re: Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-02-27 16:43 +0000
Re: Advice needed on parsing a youtube page Richard Damon <Richard@Damon-Family.org> - 2021-02-27 14:30 -0500
Re: Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-02-27 20:30 +0000
Re: Advice needed on parsing a youtube page Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-02-27 21:42 +0000
Re: Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-02-28 21:02 +0000
Re: Advice needed on parsing a youtube page Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-02-28 23:55 +0000
Re: Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-03-02 18:51 +0000
Re: Advice needed on parsing a youtube page Kristjan Robam <he12457@hotmail.com> - 2021-03-02 17:50 -0800
Re: Advice needed on parsing a youtube page Richard Damon <Richard@Damon-Family.org> - 2021-02-27 14:09 -0500
Re: Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-02-27 20:12 +0000
Re: Advice needed on parsing a youtube page Richard Damon <Richard@Damon-Family.org> - 2021-02-27 22:18 -0500
Re: Advice needed on parsing a youtube page Spiros Bousbouras <spibou@gmail.com> - 2021-03-02 17:30 +0000
csiph-web