0

Here is my output from a webpage. After

soup = BeautifulSoup(data)

I have this:

<html>
    <body>
            <p>EXCHANGE%3DNSE 

MARKET_OPEN_MINUTE=555 MARKET_CLOSE_MINUTE=930 INTERVAL=900 COLUMNS=DATE,CLOSE,HIGH,LOW,OPEN,VOLUME,CDAYS DATA=TIMEZONE_OFFSET=330 a1497240000,1634.7,1648.85,1633.85,1641.95,171301,0,1,1635.7,1644.45,1634.35,1634.7,50969,02,1640.05,1640.4,1635.5,1635.5,131752,0

Quantum Dreamer
  • 432
  • 1
  • 6
  • 17
  • I suggest you look at regular expressions. – DisappointedByUnaccountableMod Jun 12 '17 at 16:36
  • I wouldn't call that 'simple'. :) It might help us if you could reveal where you got that. – Bill Bell Jun 12 '17 at 16:44
  • If this is a question about how to parse the text entry out of the

    tags, and the suggestion is regex, you may want to see [this answer about regex and html](https://stackoverflow.com/a/1732454/1404311). You usually want to use something other than regex to get the entry out of the paragraph tag. If you can already get the text entry, and you need to know how to parse that, you may want to rewrite your question to express that that is all you are asking.

    – Scott Mermelstein Jun 12 '17 at 16:50
  • @ScottMermelstein yeah he wasn't showing _any_html tags, just the bit between

    when I posted that comment so point your finger the OP not me. I absolutely endorse that regex q/a for the general problem of parsing any/all HTML, BUT IRL for a very limited subset of HTML and in the conscious understanding that a parsing solution for a limited subset is not a solution to the general problem of parsing any/all HTML, then I say use a regex and get on with it. Of course you have to have a good handle on what the limited subset is...
    – DisappointedByUnaccountableMod Jun 12 '17 at 17:50
  • @barny Yes, when I looked at what little he posted, it did seem like this would be one of those cases where regex wouldn't necessarily be totally evil. But I get so few occasions to link to that answer that I grabbed it anyway. :-) – Scott Mermelstein Jun 12 '17 at 17:53

1 Answers1

0

The entire text is in

tag so got that p tag and used data.split(). and slicing the strings in lines again. Not sure if its the efficient way but I need only a particular value. I will look at the regex. 10Q for inputs

Quantum Dreamer
  • 432
  • 1
  • 6
  • 17