View Single Post
Old 09-27-2010, 04:44 PM   #10
marbs
Zealot
marbs began at the beginning.
 
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
i didnt see that

so if i do br.open (the 1st site) and then
br.open (the second site), that should work, as far as i can tell.
what is happening, is just visiting in the 1st site is enough to let me in to the second. i think i know how to do that.

now i have some pythoning to do (but i will have the same type of trouble with my final recipe).

this is what i am thinking of doing:
Spoiler:
Code:
from calibre.ptempfile import PersistentTemporaryFile
import mechanize
class AdvancedUserRecipe1282101454(BasicNewsRecipe):
    title          = u'TA stock table'
    oldest_article = 1
    __author__            = 'marbs'
    max_articles_per_feed = 100
    #no_stylesheets = True
    #extra_css = ' body{font-family: Arial,Helvetica,sans-serif } '
    cover_url      = 'http://money-talks.co.il/wp-content/uploads/2008/02/glasses_on_newspaper.jpg'
 
    temp_files = []
    articles_are_obfuscated = True

    def get_obfuscated_article(self, url):
        br = self.get_browser()
        br.open('http://www.tase.co.il/TASE/MarketData/Indices/MarketCap/IndexMainDataMarket.htm?Action=5&IndexID=168')
        br.open('http://www.tase.co.il/TASE/Management/GeneralPages/PopUpGrid.htm?tbl=0&Columns=he-IL_AddColColumns&Titles=he-IL_AddColTitles&ds=he-IL_ds&enumTblType=SharesByIndex&sess=he-IL_&gridName=%D7%A0%D7%AA%D7%95%D7%A0%D7%99+%D7%9E%D7%A1%D7%97%D7%A8+-+%D7%9E%D7%A0%D7%99%D7%95%D7%AA+%D7%AA%22%D7%90+%D7%9B%D7%9C%D7%9C%D7%99')
#        print_url = 'http://tase.co.il/TASEEng/Management/GeneralPages/PopUpGrid.htm?tbl=0&Columns=en-US_AddColColumns&Titles=en-US_AddColTitles&ds=en-US_ds&enumTblType=SharesByIndex&sess=en-US_&gridName=Market+Data+-+Shares+General'
#        response = br.follow_link(mechanize.Link(base_url = '', url = print_url, text = '', tag = '', attrs = []))
#        
#        html = response.read()
#
#        self.temp_files.append(PersistentTemporaryFile('_fa.html'))
#       self.temp_files[-1].write(html)
#       self.temp_files[-1].close()
#
        return br#self.temp_files[-1].name
    def get_feeds(self):
        pass


i need to dig a bit here

Last edited by marbs; 09-27-2010 at 05:02 PM.
marbs is offline   Reply With Quote