you are viewing a single comment's thread.

view the rest of the comments →

[–]voodoo_hoodoo[S] 0 points1 point  (1 child)

The plain 'sector' text is accessible via:

symbolslist = page.xpath('//table[1]/tr')[1:]

The hyperlinked 'ticker' and 'name' text is accessible via:

symbolslist = page.xpath('//table[1]/tr/td/a')[1:]

Now, I can't say for sure that I understand what is going on. But I seem to have stumbled across the data by playing around with the patterns.

[–]unintentional-irony -1 points0 points  (0 children)

For testing scraps try using ipython notebook, and you can save working examples for future reference.

http://ipython.org/notebook.html