I did a previous research about similar questions, but I really am confuse about using html objects.
I have the following situation: I Import a html from a url and I need to pick the numbers that are in the middle of the html objects:
" Gal
</B>
coord. (ep=J2000) :
</SPAN>
</TD>
<TD>
<B>
<TT>
123.5769 -02.1484
(
~
)
[
4.25 3.32 137
]
A
<A HREF="http://cdsbib.u-strasbg.fr/cgi-bin/cdsbib?1997A %26 \
A...323L..49P">1997A&A...323L..49P</A> </TT>
</B>
</TD>
</TR>
<TR>"
So I need the coordinates: 123.5769 -02.1484 , and its errors 4.25 3.32 137;
See that sometimes negative or positive numbers are possible, ok?
So I ll have to get a lot os htmls and pick the numbers that are in that same position.
Now I wiil explain my whole steps:
First I need to get the stars from url catalogue, changing just the last line in http address:"=1982ApJ...263..777G", "=1978ApJ...219..504L", etc..:
dataHyperlamers =
Import["http://simbad.harvard.edu/simbad/sim-ref?querymethod=bib&\
simbo=on&submit=submit+bibcode&bibcode=1978ApJ...219..504L",
"Hyperlinks"][[27 ;; 54]];
Length[dataHyperlamers]
Then, I make some "cleanning data":
$paralaxlamers =
Table[URLFetch[dataHyperlamers[[i]], "Content"], {i, 1,
Length[dataHyperlamers]}]
So, I get my first data:
$lamers =
TableForm[
StringTrim[#] & /@
StringCases[#, {"<TITLE>" ~~ x__ ~~ "</TITLE></head>" -> x,
"<TT>" ~~
x : RegularExpression[
"\\s+\\d+(\\.\\d+)\\s+\\[\\d+(\\.\\d+)\\]"] ->
x}] & /@ $paralaxlamers];
And I export it as .dat:
Export["TAbCataloglamersParalax.dat", $lamers];
And, Now I need to do the same as above , but getting different data from the same urls:
$lamersGal =
TableForm[
StringTrim[#] & /@
StringCases[#, {"<TITLE>" ~~ x__ ~~ "</TITLE></head>" -> x,
"Gal" ~~
x : RegularExpression[
"\\d+(\\.\\d+)\\s+\\-\\d+(\\.\\d+)\\s+\\(\\s+Optical\\s+\\)\
\\s+\\[\\d+(\\.\\d+)\\s+\\d+(\\.\\d+)\\]\\s+"] ~~ "<A" ->
x}] & /@ $paralaxlamers]
But, it is not working the last data collection...
Of course , at the final movement I will export it as .dat. So I will have tables with paralax , and galactic position of each star from the catalogues.
simbo=on&submit=submit+bibcode&bibcode=1978ApJ...219..504L – locometro Dec 03 '14 at 18:41