# 4 JC Markowitz, E Petkova, Y Neria 2015 367 # 3 JL Hamblen, PP Schnurr, A Rosenberg 2009 42 # 2 JM Ronconi, B Shiner, BV Watts 2014 99 # 1 R Bradley, J Greene, E Russ, L Dutra 2005 2675 # 6 Factors associated with completing evidence-based psychotherapy for PTSD among veterans in a national healthcare system # 5 Changes in cortisol and DHEA plasma levels after psychotherapy for PTSD # 4 Is exposure necessary? A randomized clinical trial of interpersonal psychotherapy for PTSD # 3 A guide to the literature on psychotherapy for PTSD # 2 Inclusion and exclusion criteria in randomized controlled trials of psychotherapy for PTSD # 1 A multidimensional meta-analysis of psychotherapy for PTSD Gs_df5 <- scrape_gs(term = 'intext:"psychotherapy" AND "PTSD"', pages = 81:99, crawl_delay = 1.2, useragent) # scrape last 19 pages (190 published works)Ĭheck the first 10 entries: gs_df <- rbind(gs_df1, gs_df2, gs_df3, gs_df4, gs_df5) # total of 99 pages (990 published works) # we stopped at page 99 because that's how many pages Google Scholar gives us Gs_df4 <- scrape_gs(term = 'intext:"psychotherapy" AND "PTSD"', pages = 61:80, crawl_delay = 1.2, useragent) # scrape next 20 pages (200 published works) Gs_df3 <- scrape_gs(term = 'intext:"psychotherapy" AND "PTSD"', pages = 41:60, crawl_delay = 1.2, useragent) # scrape next 20 pages (200 published works) ![]() # if you don't have proxies, just scrape sequentially and cache results Gs_df2 <- scrape_gs(term = 'intext:"psychotherapy" AND "PTSD"', pages = 21:40, crawl_delay = 1.2, useragent) # scrape next 20 pages (200 published works) # even with some human-like behavior, the crawling script still gets blocked by server if run too long Gs_df1 <- scrape_gs(term = 'intext:"psychotherapy" AND "PTSD"', pages = 1:20, crawl_delay = 1.2, useragent) # scrape first 20 pages (200 published works) # proxy1 <- httr::use_proxy("5.78.83.190", port = 8080) # can pass proxy to function here we just scrape patiently and don't use proxy Proxy_ip <- jsonlite::fromJSON(page_text)$ip Page_text <- rvest::html_text(rvest::read_html(session)) Jsonlite::fromJSON(rvest::html_text(rvest::read_html("")))$ip If (require(jsonlite)) install.packages("jsonlite") If you use proxies you should check that they are working: # Run the web scraping function # Source web scraping function Lapply(packages, library, character.only = TRUE)Ģ. Installed_packages <- packages %in% rownames(installed.packages()) If (require(litsearchr)) remotes::install_github("elizagrames/litsearchr", ref = "main") Load or install packages # litsearchr isn't yet on CRAN, need to install from github ![]() ggplot2, ggraph, and ggrepel for plotting.ġ. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |