Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #12278

Re: Advice needed on parsing a youtube page

From Spiros Bousbouras <spibou@gmail.com>
Newsgroups comp.programming
Subject Re: Advice needed on parsing a youtube page
Message-ID <y5A2DjxJJoXPajib@bongo-ra.co> (permalink)
References <Rafaello@bongo-ra.co> <wNw_H.30423$X63.12490@fx39.iad>
Organization virginmedia.com
Date 2021-02-27 20:12 +0000

Show all headers | View raw


On Sat, 27 Feb 2021 14:09:16 -0500
Richard Damon <Richard@Damon-Family.org> wrote:
> On 2/27/21 9:43 AM, Spiros Bousbouras wrote:
> > I have some code which parses the source of pages for youtube videos and
> > prints some information. My code has been working fine for months but
> > recently it choked on  https://www.youtube.com/watch?v=w2itwFJCgFQ .After
> > some investigations I found the part of the page which causes the problem :
> > there is a single appearance of
> > 
> >     content="\Raffaello D&#39;Andrea\"
> > 
> > .My code assumed that the closing double quote is escaped so it did not count
> > it as a closing quote and so parsed incorrectly the rest of the page. So I
> > have 2 questions :

[...]

> I think the issue is that \" is NOT an escaped quote in HTML, but the
> character \ at the end of the string.
> 
> If you want to insert a " into a string, you use @quot; or @#34;
> 
> Note the leading \R, this is not some special R character, and the &#39;
> which is an encoded ' character.
> 
> You are parsing the page with the wrong grammar (for a different
> language that DOES use \" as the way to escape a quote)

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.

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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