EasySpider icon indicating copy to clipboard operation
EasySpider copied to clipboard

如何提取<a>标签的href属性的值

Open sxtyzt opened this issue 1 year ago • 14 comments

大神您好,我在使用您的软件时遇到困扰我的问题

1 比如 /html/body/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[3]/div[2]/a[1] 但提取不到链接地址 /html/body/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[3]/div[2]/a[1]/@href 这条语句可以正确匹配到数据,软件该如何设置才能输出上述 Xpath 的数据 2 运行循环点击该图片进入二级页面采集数据时运行一段时间软件会自动退出。采集的数据不完全有缺失

采集的网址为 https://www.gamestorrents.fm/juegos-pc/page/1/----https://www.gamestorrents.fm/juegos-pc/page/337/

关键页面结构为

<div class="col-md-2 w3l-movie-gride-agile">
    <a href="https://www.gamestorrents.fm/juegos-pc/uru-complete-chronicles-engi-know/" class="hvr-shutter-out-horizontal">
	<img style="background-image: url('https://www.gamestorrents.fm/wp-content/uploads/portadas/URU-Complete-Chronicles-[ENG][I-KnoW]-(Poster).jpg')" src="https://www.gamestorrents.fm/wp-content/themes/GamesTorrent/css/images/portada_background.png" class="img-responsive lapinio" alt="Juegos PC - URU Complete Chronicles [ENG][I KnoW]" title="Juegos PC - URU Complete Chronicles [ENG][I KnoW]">
	 <span class="miklonio">Aventuras</span>
	 <span class="pc_games_cracker">I_KnoW </span>
	 <span class="last_flags"><img class="flagens" src="https://www.gamestorrents.fm/wp-content/themes/GamesTorrent/css/images/flags/eng.png" title="Idioma English" alt="Idioma English"></span>
   </a>
 <div class="pintinia mid-1 agileits_w3layouts_mid_1_home">
	<div class="w3l-movie-text">
	  <h6 class="game_name">
	     <a href="https://www.gamestorrents.fm/juegos-pc/uru-complete-chronicles-engi-know/" title="URU Complete Chronicles">URU Complete Chronicles</a>
	   </h6>							
	</div>
 </div>
</div>

sxtyzt avatar Jun 18 '23 16:06 sxtyzt

Are you using FormProvider? https://react-hook-form.com/docs/useformcontext

joaom00 avatar Jun 20 '23 23:06 joaom00

Yes, the "Form" component is the form provider on the library, it is matching the shadcn docs, didn't change anything.

SamuelPires1999 avatar Jun 20 '23 23:06 SamuelPires1999

And passing all the values returned from useForm?

const form = useForm()

<Form {...form}>
  ...
</Form>

joaom00 avatar Jun 21 '23 00:06 joaom00

I'm getting this error as well. Same situation: brand new project, followed the docs.

landendanyluk avatar Jun 23 '23 20:06 landendanyluk

In the same boat here

dexxiez avatar Jun 25 '23 05:06 dexxiez

same

alfieqashwa avatar Jun 27 '23 09:06 alfieqashwa

Make sure you import "Form" from the UI file, not from react-hook-form

DavidIlie avatar Jun 27 '23 11:06 DavidIlie

Make sure you import "Form" from the UI file, not from react-hook-form

Yeah, I am and the issue still persists sadly. All components generated from the latest version of the CLI.

EDIT: I'm sorry I'm surrendering my licence to use a computer right now. import { Controller, Form, useForm } from 'react-hook-form';

cosmictoby avatar Jun 27 '23 23:06 cosmictoby

Make sure you import "Form" from the UI file, not from react-hook-form

solved for me! thanks

dillionverma avatar Jun 28 '23 00:06 dillionverma

Make sure you import "Form" from the UI file, not from react-hook-form

Thank you.

alfieqashwa avatar Jun 28 '23 05:06 alfieqashwa

Make sure you import "Form" from the UI file, not from react-hook-form

🤝

riltonbispo avatar Dec 18 '23 00:12 riltonbispo

Make sure you import "Form" from the UI file, not from react-hook-form

This solved my problem! Thank you!

rafmaghari avatar Jan 07 '24 11:01 rafmaghari

Make sure you import "Form" from the UI file, not from react-hook-form

Arrghh! Thank you!

John-Dennehy avatar Feb 02 '24 14:02 John-Dennehy

Make sure you import "Form" from the UI file, not from react-hook-form

Thank You , Life save

aadil6971 avatar Feb 10 '24 19:02 aadil6971

Anyone else starting to wonder if this Form component should have been called FormWrapper given we still need the <form > element inside anyway. Especially given how many of us are accidentally importing the react-hook-form version 🤣

John-Dennehy avatar Mar 05 '24 14:03 John-Dennehy

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jun 23 '24 23:06 shadcn

Make sure you import "Form" from the UI file, not from react-hook-form

Thank you man, you're live saver !!!

GurbanmyradowSerdar avatar Jun 28 '24 15:06 GurbanmyradowSerdar