在C#上使用HTMLAgilityPack解析标签<Option selected value>

时间:2019-12-05 12:58:30

标签: c# html-agility-pack

请帮助我解析以下html:

postList = (e) => {
    e.preventDefault();


    var postParams;
    if(this.state.message && this.state.parent){

      postParams = {
        message: this.state.message,
        chat_m_id: this.state.parent,
        depth: (1).toString(),
        msg_icon: this.state.msg_icon.name
      }
    }
    else{    
      postParams = {
        message: this.state.message,
        chat_m_id: (0).toString(),
        depth: (0).toString(),
        msg_icon: this.state.msg_icon.name
      }
    }
    console.log(postParams);
    let bodyFormData = new FormData();

    //approach-one
      bodyFormData.append('data',postParams);

    //approach-one
      // bodyFormData.append('data',JSON.stringify(postParams));

    //approach-three
      // for (let [key, value] of Object.entries(postParams)) {
      //     bodyFormData.append(`'${key}'`, JSON.stringify(`${value}`));
      // }

console.log(bodyFormData) //this is always empty


    axios.post(GlobalVar.BASE_URL+'api/msgtemplate/create', bodyFormData, {headers: GlobalVar.headersFormData})
    .then(res => {
      console.log(res)
      this.props.history.push('/messages')
    })
    .catch(err => console.log(err.res));

  }

使用HAP,我只想获取第二行并获取“ 66”和“里斯本”值。

0 个答案:

没有答案