<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to scrape data from a webpage in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779520#M248276</link>
    <description>&lt;P&gt;I copied the URL from the download link, and ran this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ht temp;

proc http
  url="https://www.destatis.de/DE/Themen/Laender-Regionen/Regionales/Gemeindeverzeichnis/Administrativ/Archiv/GVAuszugJ/31122020_Auszug_GV.xlsx;jsessionid=B4477D957BFAB0E007E62A86373ED7F9.live711?__blob=publicationFile"
  out=ht
;
run;

proc import
  datafile=ht
  out=test
  dbms=xlsx
  replace
;
sheet="Onlineprodukt_Gemeinden";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Nov 2021 08:50:59 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-11-10T08:50:59Z</dc:date>
    <item>
      <title>how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779511#M248271</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;I have a question. I need a code to export data (xlsx) from this website to sas.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(please note that the site is in german)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.destatis.de/SiteGlobals/Forms/Suche/Expertensuche_Formular.html?resourceId=2402&amp;amp;input_=2408&amp;amp;pageLocale=de&amp;amp;templateQueryString=Alle+politisch+selbst%C3%A4ndigen+Gemeinden+mit+ausgew%C3%A4hlten+Merkmalen+&amp;amp;submit.x=0&amp;amp;submit.y=0" target="_blank" rel="noopener"&gt;https://www.destatis.de/SiteGlobals/Forms/Suche/Expertensuche_Formular.html?resourceId=2402&amp;amp;input_=2408&amp;amp;pageLocale=de&amp;amp;templateQueryString=Alle+politisch+selbst%C3%A4ndigen+Gemeinden+mit+ausgew%C3%A4hlten+Merkmalen+&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please could any one help ?&lt;/P&gt;
&lt;P&gt;I need probably a macro to download all the excel files for all subsequent years (I will like to download sheet2, the first sheet is not required). I saw a blog which posted this code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename src temp;
proc http
 method="GET"
 url="https://www.destatis.de/SiteGlobals/Forms/Suche/Expertensuche_Formular.html?resourceId=2402&amp;amp;input_=2408&amp;amp;pageLocale=de&amp;amp;templateQueryString=Alle+politisch+selbst%C3%A4ndigen+Gemeinden+mit+ausgew%C3%A4hlten+Merkmalen+&amp;amp;submit.x=0&amp;amp;submit.y=0"
 out=src;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which I tried to use, but it seems am not doing the right thing.&lt;/P&gt;
&lt;P&gt;I will appreciate any help.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 07:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779511#M248271</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-10T07:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779520#M248276</link>
      <description>&lt;P&gt;I copied the URL from the download link, and ran this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ht temp;

proc http
  url="https://www.destatis.de/DE/Themen/Laender-Regionen/Regionales/Gemeindeverzeichnis/Administrativ/Archiv/GVAuszugJ/31122020_Auszug_GV.xlsx;jsessionid=B4477D957BFAB0E007E62A86373ED7F9.live711?__blob=publicationFile"
  out=ht
;
run;

proc import
  datafile=ht
  out=test
  dbms=xlsx
  replace
;
sheet="Onlineprodukt_Gemeinden";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Nov 2021 08:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779520#M248276</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-10T08:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779524#M248280</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; Thanks for that. The only problem is that the columnnames are not read in properly. Is there anyway to state that these variablenames should be used as the columnnames?&amp;nbsp; Satzart,&amp;nbsp;Textkennzeichen, land, RB, Kreis, VB, Gem, Gemeinde, Fläche as Flaeche, insgesamt, männlich as maennlich, je km as km, Längengrad as Laengengrad, Breitengrad&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 09:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779524#M248280</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-10T09:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779525#M248281</link>
      <description>&lt;P&gt;The problem here is that these spreadsheets have obviously not been created with further machine processing in mind. Some column "names" are in row 3, others in row 4. You will have to do a lot of work in a follow-up data step to set your intended column names manually (either by renaming, or by creating new variables). PROC IMPORT will result with all columns as character, so you must also convert to numeric where needed.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 10:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779525#M248281</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-10T10:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779527#M248282</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;: okay, thankyou&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 10:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779527#M248282</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-10T10:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779530#M248285</link>
      <description>&lt;P&gt;Depending on your environment, you might be able to convert the xlsx to csv by using VBA with Office (Windows), or LibreOffice (Linux) from the commandline. The csv will then be much easier to read in a data step where you have full control over everything (column names and types, start of data, etc).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 10:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779530#M248285</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-10T10:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to scrape data from a webpage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779544#M248293</link>
      <description>&lt;P&gt;okay&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 11:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scrape-data-from-a-webpage/m-p/779544#M248293</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-10T11:54:18Z</dc:date>
    </item>
  </channel>
</rss>

