[R-sig-eco] Webscraping the Plants Database

Tim Seipel t.seipel at env.ethz.ch
Wed Jan 2 23:58:50 CET 2013


Thanks Sarah,
Didn't realize you can go through advanced search webpage to get all the 
fields!
Thanks,
Tim


On 02.01.13 23:43, Sarah Goslee wrote:
> Sorry, hit send too quickly.
>
> To get the parts you want, you need to go through the advanced search
> and download. That tool will provide you with a neat csv file.
>
> On Wed, Jan 2, 2013 at 5:48 PM, Tim Seipel <t.seipel at env.ethz.ch> wrote:
>> Dear Listserv,
>>
>> My aim is to compile plant traits for a list of species from the USDA
>> Plants database.
>> Examples from the list include
>>
>> Poa pratensis
>> Festuca idahoensis
>> Astragalus miser
>>
>> In R, I started with this:
>>
>> library(RCurl)
>> ###############################################
>> plants<-'http://plants.usda.gov/java/nameSearch?'
>> ###############################################
>> url<-paste('mode=','sciname','&keywordquery=','Festuca baffinensis',sep='')
>> sp.url<-paste(plants,url,sep='')
>>
>> ###the link goes to the correct webpage
>> http://plants.usda.gov/java/nameSearch?mode=sciname&keywordquery=Festuca
>> baffinensis
>> <http://plants.usda.gov/java/nameSearch?mode=sciname&keywordquery=Festuca%20baffinensis>
>>
>> p1<-getURL(sp.url)
>>
>>
>> I would like to extract the following text from the page:
>> Symbol:                 FEBA
>> Group:          Monocot
>> Family:                 Poaceae
>> Duration:               Perennial
>> Growth Habit: <http://plants.usda.gov/java/nameSearch#>                 Graminoid
>> Native Status: <http://plants.usda.gov/java/nameSearch#>
>> L48             N
>> AK              N
>> CAN             N
>> GL              N
>>
>>
>>
>> However I can't seem to find it after parsing the string? Is this
>> related to Java script?
>>
>> Can someone help me extract this information.
>> Thanks for the help!
>>
>> Sincerely,
>> Tim Seipel
>>
>>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org



More information about the R-sig-ecology mailing list