查找PayPal购买现在按钮重定向链接

发布于 2025-01-25 10:30:43 字数 905 浏览 1 评论 0原文

我正在尝试制作一个可以刮擦网站并搜索PayPal购买按钮重定向链接的程序。

我可以刮擦网站,但我意识到,当您点击按钮时,它不包含您将被重定向到购买的URL。我将如何找到按钮重定向链接,甚至如何进行网站刮擦并单击按钮以至少显示重定向站点?我是否必须以某种方式使刮板命中表格并提交?

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input name="cmd" type="hidden" value="_s-xclick" /><br />
<input name="hosted_button_id" type="hidden" value="PUEGWVJXLH4FQ" /><br />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" /><br />
<img loading="lazy" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" /></form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">_______________________________________________________</p>
</form>

I am trying to make a program that can scrape a site and search for PayPal buy now button redirection links.

I can scrape the site but I realize that when you hit the button, it does not contain the URL that you will be redirected to make purchase. How would I go about finding the button redirection link, or even how would I have the site scrape and click on the button to at least have the redirect site appear? Would I somehow have to make the scraper hit the form and submit?

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input name="cmd" type="hidden" value="_s-xclick" /><br />
<input name="hosted_button_id" type="hidden" value="PUEGWVJXLH4FQ" /><br />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" /><br />
<img loading="lazy" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" /></form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">_______________________________________________________</p>
</form>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫瑟鸿黎 2025-02-01 10:30:43

转到 https://www.paypal.co/buttons )创建一个使用没有下拉选项和文本字段的新简单购买按钮(需要HTML) - 一旦创建了按钮,并且您正在查看生成的代码,请切换到“ E-邮寄“上方”标签。

该电子邮件选项卡中的链接将具有托管按钮ID,您可以将其交换 /使用以动态生成您所要求的“重定向链接”。加载在浏览器中时,该链接将启动结帐,与单击按钮相同。


还有其他几种类型的PayPal付款按钮,包括:

  • 未播放的现在购买按钮(在PayPal上没有保存,并且没有hosted_button_id)。 These buttons use a redirection link or form post that will 包括HTML变量设置付款。
  • 较新的智能按钮,通过 https://wwwww.paypal.com/buttons/buttons/smart/smart 类似 - 这些没有重定向URL,而是使用JS打开一个迷你窗口供付款批准。

构建工作URL的另一种方法是从表单的操作参数开始获取字符串,并从具有name的表单中添加所有输入,并带有语法name = value,由'&amp;'隔开....所以:例如:

https://www.paypal.com/cgi-bin/webscr?hosted_button_id = puegwvjxlh4fq&amp; enothername = enternValue&amp; ...

Go to https://www.paypal.co/buttons, log in, and (after logging in) create a new simple Buy Now button with no dropdown options nor text fields (which require HTML) -- and once the button is created and you are viewing the generated code, switch over to the "E-mail" tab above it.

The link in that E-mail tab will have a hosted button ID, which you can swap out / use to dynamically generate the Buy Now "redirection link" you're asking for. When loaded in a browser, that link will initiate a checkout, same as clicking the button.


There are several other types of PayPal payment buttons, including:

  • Unhosted Buy Now buttons (which are not saved at PayPal, and do not have a hosted_button_id). These buttons use a redirection link or form post that will include HTML variables to set up the payment.
  • Newer smart buttons, generated via https://www.paypal.com/buttons/smart or similar -- these do not have redirection URL, and instead use JS to open a mini window for payment approval.

Another way to construct a working URL is to begin with the form's action parameter https://www.paypal.com/cgi-bin/webscr, add ? to begin a GET string, and add all the inputs from the form that have a name, in with the syntax name=value, separated by '&' .... so for example:

https://www.paypal.com/cgi-bin/webscr?hosted_button_id=PUEGWVJXLH4FQ&anothername=anothervalue&...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文