Thread: maya recipe
View Single Post
Old 10-08-2010, 09:13 AM   #11
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by marbs View Post
but i need some help fixing it.
i marked it HERE in the code. i want to format the url as u"www....com" i am giving it a simple string. i tried ' and " and []. still cant get the syntax right. can i get some help with that?
It looks correct to me, except:
Quote:
Code:
    INDEX = '"http://maya.tase.co.il/'
This has an extra leading quote - it should be
Quote:
Code:
    INDEX = 'http://maya.tase.co.il/'
And: don't you want 'the new soup is', soup1 instead of 'the new soup is', temp2
And: I don't see any iframes in soup1?
Quote:
Spoiler:
Code:
            if not re.search('javascript', item['href']):
              temp3= self.INDEX + item['href']                                #HERE
             # temp2=[temp3]
              print 'url1 is', temp2
              soup1 = self.index_to_soup(temp3)                            #AND HERE
              print 'the new soup is', temp2
              print '6714' 
              for item1 in soup1.findAll('iframe'):
                 print 'item1 is:' , item1
                 print 'FOUND GOOD URL'
                 url = item1['src']
                 print 'url is: ', url
                 title       = self.tag_to_string(item)
                 print 'title is: ', title
                 current_articles.append({'title': title, 'url': url, 'description':'', 'date':''}) # append all this
            
           
        return current_articles
Starson17 is offline   Reply With Quote