0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【2020.12最新】PHPでGoogle Suggestを読み取る方法

Last updated at Posted at 2020-10-31

こちらのGoogle Suggest APIを使って、
https://so-zou.jp/web-app/tech/web-api/google/suggest/
XMLを取得して簡単にデータ取れる!って思ってたんですが、初心者だからか引っかかる部分があり、変に時間を要してしまったので記録を残します。

https://yululy.com/google_suggest_api/
このブログの通りに入力し、phpで実行したら... なぜか実行できない。

何も表示されない+こういうエラーが出る..。
image.png

Uncaught TypeError: Cannot read property 'src' of null
    at Module.<anonymous> (commons.js:83)
    at __webpack_require__ (content.js:1)
    at Object.<anonymous> (commons.js:83)
    at __webpack_require__ (content.js:1)
    at Object.<anonymous> (commons.js:83)
    at __webpack_require__ (content.js:1)
    at Object.<anonymous> (commons.js:83)
    at __webpack_require__ (content.js:1)
    at Object.<anonymous> (commons.js:83)
    at __webpack_require__ (content.js:1)
(anonymous) @ commons.js:83
__webpack_require__ @ content.js:1
(anonymous) @ commons.js:83
__webpack_require__ @ content.js:1
(anonymous) @ commons.js:83
__webpack_require__ @ content.js:1
(anonymous) @ commons.js:83
__webpack_require__ @ content.js:1
(anonymous) @ commons.js:83
__webpack_require__ @ content.js:1
checkDeferredModules @ content.js:1
(anonymous) @ content.js:1
(anonymous) @ content.js:1

そして、たまたまHTMLの基本的な形のを入力したら普通に読み取ることができました。
image.png

image.png

phpって単体だと動作しないのかな..?
ありがとうございました。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?