teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

タイトル変更、問題点がわかったので

2019/01/03 10:36

投稿

Kommm
Kommm

スコア20

title CHANGED
@@ -1,1 +1,1 @@
1
- curlのスクレ、qiitaから取得したが何故かemptyと返される
1
+ curlmでqiitaにログインできな
body CHANGED
@@ -1,4 +1,4 @@
1
- 1/2更新しました
1
+ 1/3更新しました
2
2
 
3
3
  ```
4
4
  curl -c cookie.txt -d "identity=自分のID" -d "password=自分のパスワード" "https://qiita.com/login"
@@ -6,7 +6,7 @@
6
6
  ```
7
7
 
8
8
  このコマンドで取得できるはずかと思ったのですが、なぜか取得できません。
9
- 他のページでは違うコマンドにはなりますが取得できました。
9
+ 他のページでは違うコマンドにはなりますが取得できましたので、useragentで拒否はしていないようです
10
10
  ```
11
11
  curl -s -L "https://qiita.com/search?q=python&sort=created" | xmllint --html --xpath "//h1/a" -
12
12
  ```

1

mm更新

2019/01/03 10:36

投稿

Kommm
Kommm

スコア20

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,8 @@
1
+ 1/2更新しました
2
+
1
3
  ```
4
+ curl -c cookie.txt -d "identity=自分のID" -d "password=自分のパスワード" "https://qiita.com/login"
2
- curl -s -L "https://qiita.com" | xmllint --html --xpath '//a[@class="tr-Item_title"]' -
5
+ curl -b cookie.txt -s -L "https://qiita.com" | xmllint --html --xpath '//a[@class="tr-Item_title"]' -
3
6
  ```
4
7
 
5
8
  このコマンドで取得できるはずかと思ったのですが、なぜか取得できません。
@@ -8,4 +11,4 @@
8
11
  curl -s -L "https://qiita.com/search?q=python&sort=created" | xmllint --html --xpath "//h1/a" -
9
12
  ```
10
13
 
11
- 何かスクレイピングブロックをかけてるのでしょうか?
14
+ cookieの使い方が間違っるのでしょうか?