Webpage Information Crawl problem (continued), Trouble Xu version to see

Source: Internet
Author: User
Original address:
http://bbs.csdn.net/topics/390595542 4#

If the full page information is:
Array (...). [Sheet] = = Part information parts list [+] = [[+] = [[+]] = [[+] = [ [+] = [[[]] [[[]] = [[+]] [[+] = number of packages [+] = number of boxes [[+] = bin number [+] [] [[]] [[]] = [] =     Actual number of boxes [[+]] = Real material receipt box number [[]/[+] = number of boxes [+] = [98] = 1 [[+] = 12606260 [+] = model [101] = 480 [102] = 480 [103] = [104] [106] = [4] [[]] + [+] = [107]  ] = [108] = [109] = [[]] = [111] [[] = [] + [] = 2 [113] = 12615516 [114]  + Throttle Controller control module [[+]-[+]-[+]-[117] = [118] [+] [119] + [[]] [[]] = [+] =             0ptyn007 [121] = [122] = [123] = [124] = [[]] = [126] = Supplier Signature Carrier Signature supplier Signature _____________ carrier Signature ____________  _  [127] = Supplier Confirm Time supplier confirmation period 13-09-10 09:01 [+] = Receiver Signature Receipt Person signature _______________ [129] + date Date ______________ [] + * * * END of PAGE * * *)


More cells from 126 to 130. In this case Array_combine will report warning error, Both parameters should has an equal number of elements.

If you want to match exactly, how do you filter the content information for unit 126-130?


Reply to discussion (solution)

The Array_combine function needs to participate in the operation of the two arrays of the same length, if you cannot guarantee this, do not use
Your 126-130 unit content is not in the two-dimensional table, of course, it needs to be handled separately

You might be able to
[Information] = = part
As the beginning of a two-dimensional table
[126] = Supplier
As the end of a two-dimensional table

You might be able to
[Information] = = part
As the beginning of a two-dimensional table
[126] = Supplier
As the end of a two-dimensional table

Can you write down an example? is the key value must be specified? Or as long as the result of the value is possible?

It's up to you to decide what to do.
I'm using array_combine just to tell you that you can do it.

It's up to you to decide what to do.
I'm using array_combine just to tell you that you can do it.
I mean, specify the starting and ending positions. Do you depend on the value of the array or the same key value?

It's up to you to decide what to do.
I'm using array_combine just to tell you that you can do it.

It's done. Since the last five elements are fixed, the Array_slice function is used, and a array_diff function is used to remove the following 5 rows of data. Thank you so much!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.