<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>ORATORIOのブログ</title>
<link>https://ameblo.jp/serioratorio/</link>
<atom:link href="https://rssblog.ameba.jp/serioratorio/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>ブログの説明を入力します。</description>
<language>ja</language>
<item>
<title>EXCELからWebデータを取得する</title>
<description>
<![CDATA[ <p>とりあえずEXCEL(VBA)からHTTPにアクセスしてソースを持ってきてみる</p><br><p>現在の課題としては…･･･</p><br><p>１．事前にサイトの文字コードを調べたいけど方法が不明(現在は呼び出し元で決めうち)<br>２．サイトの存在、サイトURLのチェックを入れるべきか？(やるとすればAPIで対応予定)<br>３．『MSXML2.XMLHTTP』を使いたいけど .send()でno-chaseを送信しても無視される？謎</p><br><p>アメブロは色つけるのがメンドイ気がする</p><p>慣れてないだけかな</p><br><p><font color="#000000">---------------------------------------------------------------------------<br>'機能：HTMLデータの取得<br>'備考：センス悪い<br>'作成：2010/08/27<br>'更新：<br>'---------------------------------------------------------------------------</font><br>Public Function ReadHtmlSource(ByVal pUrl As String, _<br>                                           ByVal pOption As String, _<br>                                           ByRef pSource As String, _<br>                                           Optional ByVal pSJIS As Boolean) As Boolean<br><br>  'Get Ready(^ω^)ノ<br>  Dim ohttp As Object<br>  Set ohttp = CreateObject("Microsoft.XMLHTTP")</p><p>  'Set ohttp = CreateObject("MSXML2.XMLHTTP") <font color="#000000">'Sendの方法が違う？</font></p><p>  Dim cnt As Integer<br><br>  'オブジェクトの作成チェック<br>  If ohttp Is Nothing Then<br>    MsgBox "『MSXML2.XMLHTTP』オブジェクトの作成に失敗しました。", vbCritical<br>    Exit Function<br>  End If</p><br><p>  'HTTPリクエスト<br>  ohttp.Open "GET", pUrl, False '同期通信(False)<br>  ohttp.Send (pOption)</p><p><br>  '取得結果チェック...レベル低いな(汗</p><p>  While (ohttp.readystate &lt;&gt; 4)</p><p><br>    If cnt &gt; 5 Then<br>      MsgBox "『HTMLデータ』の取得に失敗(未完了)しました。", vbCritical<br>      Exit Function<br>    End If</p><br><p>    Application.Wait [NOW()+"0:00:00.5"]<br>    cnt = cnt + 1</p><p><br>  Wend</p><br><p>  If ohttp.Status &lt; 200 Or ohttp.Status &gt;= 300 Then</p><p>    MsgBox "『HTMLデータ』の取得に失敗(サイトエラー)しました。", vbCritical<br>    Exit Function</p><p>  End If</p><p><br>  'ソースの取得</p><p>  If pSJIS = True Then<br>    pSource = StrConv(ohttp.responseBody, vbUnicode)<br>  Else<br>    pSource = ohttp.responseText<br>  End If</p><br><p>  'Release<br>  Set ohttp = Nothing</p><br><p>  'Return<br>  ReadHtmlSource = True</p><p>  End Function</p><br>
]]>
</description>
<link>https://ameblo.jp/serioratorio/entry-10634161626.html</link>
<pubDate>Mon, 30 Aug 2010 10:09:44 +0900</pubDate>
</item>
<item>
<title>はじめてみる</title>
<description>
<![CDATA[ FC2が重過ぎるから移行
]]>
</description>
<link>https://ameblo.jp/serioratorio/entry-10634158929.html</link>
<pubDate>Mon, 30 Aug 2010 10:07:46 +0900</pubDate>
</item>
</channel>
</rss>
